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/io/qwindowspipereader.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/io/qwindowspipereader.cpp')
-rw-r--r-- | src/corelib/io/qwindowspipereader.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
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; } |