From 4ed4bca5f3000e2ed68f81b35fbe8d586a6e67f1 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sun, 1 Jan 2017 22:04:36 +0000 Subject: [PATCH] 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 --- src/chrono.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/chrono.cpp b/src/chrono.cpp index e9030f1ee..842d0cc45 100644 --- a/src/chrono.cpp +++ b/src/chrono.cpp @@ -160,14 +160,14 @@ steady_clock::now() _NOEXCEPT 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)