chrono: address post-commit comments from majnemer

Correct style to match libc++ style as pointed out by David Majnemer on
IRC.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290805 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Saleem Abdulrasool
2017-01-01 22:04:36 +00:00
parent 75748cde64
commit 4ed4bca5f3

View File

@@ -160,14 +160,14 @@ steady_clock::now() _NOEXCEPT
steady_clock::time_point steady_clock::time_point
steady_clock::now() _NOEXCEPT steady_clock::now() _NOEXCEPT
{ {
static LARGE_INTEGER liFreq; static LARGE_INTEGER freq;
static BOOL bQPFRun = FALSE; static BOOL initialized = FALSE;
if (bQPFRun == FALSE) if (!initialized)
bQPFRun = QueryPerformanceFrequency(&liFreq); initialized = QueryPerformanceFrequency(&freq); // always succceeds
LARGE_INTEGER liCntr; LARGE_INTEGER counter;
QueryPerformanceCounter(&liCntr); QueryPerformanceCounter(&counter);
return time_point(duration(liCntr.QuadPart * nano::den / liFreq.QuadPart)); return time_point(duration(counter.QuadPart * nano::den / freq.QuadPart));
} }
#elif defined(CLOCK_MONOTONIC) #elif defined(CLOCK_MONOTONIC)