File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33namespace ECFMP ::Time {
44
5- std::chrono::system_clock::time_point testNow = std::chrono::system_clock::time_point::min();
5+ auto DefaultTime () -> std::chrono::system_clock::time_point
6+ {
7+ return (std::chrono::system_clock::time_point::min)();
8+ }
9+
10+ std::chrono::system_clock::time_point testNow = DefaultTime();
611
712 auto TimeNow () -> std::chrono::system_clock::time_point
813 {
9- if (testNow != std::chrono::system_clock::time_point::min ()) {
10- return testNow;
11- }
12-
13- return std::chrono::system_clock::now ();
14+ return testNow != DefaultTime () ? testNow : std::chrono::system_clock::now ();
1415 }
1516
1617 void SetTestNow (const std::chrono::system_clock::time_point& now)
@@ -20,6 +21,6 @@ namespace ECFMP::Time {
2021
2122 void UnsetTestNow ()
2223 {
23- testNow = std::chrono::system_clock::time_point::min ();
24+ testNow = DefaultTime ();
2425 }
2526}// namespace ECFMP::Time
You can’t perform that action at this time.
0 commit comments