diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-08-29 09:07:43 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-02 12:41:07 +0000 |
commit | 7c0884f2a2b02ed91ee49f79ef2fff27c2567c39 (patch) | |
tree | 64661ff40d4e36b6320c1bd2ff5d15d56a446875 /src/corelib/kernel/qelapsedtimer_win.cpp | |
parent | 30756f4626972d90e1b6e24f495260c1268c9181 (diff) |
Windows code: Fix clang-tidy warnings about else after jumps
Replace by switch() where appropriate, remove else and unindent code
or simplify the return value.
Change-Id: Ie988b9068a9579ae5a899b3765e43aad480b564e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qelapsedtimer_win.cpp')
-rw-r--r-- | src/corelib/kernel/qelapsedtimer_win.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/corelib/kernel/qelapsedtimer_win.cpp b/src/corelib/kernel/qelapsedtimer_win.cpp index 54a14e690c..a63290d2f8 100644 --- a/src/corelib/kernel/qelapsedtimer_win.cpp +++ b/src/corelib/kernel/qelapsedtimer_win.cpp @@ -72,10 +72,9 @@ static inline qint64 ticksToNanoseconds(qint64 ticks) qint64 seconds = ticks / counterFrequency; qint64 nanoSeconds = (ticks - seconds * counterFrequency) * 1000000000 / counterFrequency; return seconds * 1000000000 + nanoSeconds; - } else { - // GetTickCount(64) return milliseconds - return ticks * 1000000; } + // GetTickCount(64) returns milliseconds + return ticks * 1000000; } static inline qint64 nanosecondsToTicks(qint64 nsec) @@ -115,10 +114,7 @@ QElapsedTimer::ClockType QElapsedTimer::clockType() Q_DECL_NOTHROW { resolveCounterFrequency(); - if (counterFrequency > 0) - return PerformanceCounter; - else - return TickCounter; + return counterFrequency > 0 ? PerformanceCounter : TickCounter; } bool QElapsedTimer::isMonotonic() Q_DECL_NOTHROW |