chrono: address post-commit comments from majnemer
Correct style to match libc++ style as pointed out by David Majnemer on
IRC. NFC.
llvm-svn: 290805
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: cfc01154c3853ecb10c7974b4a388192becf5d32
diff --git a/src/chrono.cpp b/src/chrono.cpp
index e9030f1..842d0cc 100644
--- a/src/chrono.cpp
+++ b/src/chrono.cpp
@@ -160,14 +160,14 @@
steady_clock::time_point
steady_clock::now() _NOEXCEPT
{
- static LARGE_INTEGER liFreq;
- static BOOL bQPFRun = FALSE;
- if (bQPFRun == FALSE)
- bQPFRun = QueryPerformanceFrequency(&liFreq);
+ static LARGE_INTEGER freq;
+ static BOOL initialized = FALSE;
+ if (!initialized)
+ initialized = QueryPerformanceFrequency(&freq); // always succceeds
- LARGE_INTEGER liCntr;
- QueryPerformanceCounter(&liCntr);
- return time_point(duration(liCntr.QuadPart * nano::den / liFreq.QuadPart));
+ LARGE_INTEGER counter;
+ QueryPerformanceCounter(&counter);
+ return time_point(duration(counter.QuadPart * nano::den / freq.QuadPart));
}
#elif defined(CLOCK_MONOTONIC)