From 7c0884f2a2b02ed91ee49f79ef2fff27c2567c39 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 29 Aug 2018 09:07:43 +0200 Subject: 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 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qelapsedtimer_win.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/corelib/kernel/qelapsedtimer_win.cpp') 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 -- cgit v1.2.3