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/io/qwindowspipereader.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/corelib/io/qwindowspipereader.cpp') diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp index 2312d5ca63..15c9f52cf3 100644 --- a/src/corelib/io/qwindowspipereader.cpp +++ b/src/corelib/io/qwindowspipereader.cpp @@ -270,13 +270,11 @@ void QWindowsPipeReader::readFileCompleted(DWORD errorCode, DWORD numberOfBytesT DWORD QWindowsPipeReader::checkPipeState() { DWORD bytes; - if (PeekNamedPipe(handle, NULL, 0, NULL, &bytes, NULL)) { + if (PeekNamedPipe(handle, nullptr, 0, nullptr, &bytes, nullptr)) return bytes; - } else { - if (!pipeBroken) { - pipeBroken = true; - emit pipeClosed(); - } + if (!pipeBroken) { + pipeBroken = true; + emit pipeClosed(); } return 0; } -- cgit v1.2.3