From af385fc34a98023ba2ab854f8890c6983ae57a3a Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Sat, 4 Apr 2020 21:16:56 +0200 Subject: clang-tidy: Fix 'readability-*' warnings Treat those as errors except for the 'readability-container-size-empty' Change-Id: I6a8bb9d68fb5bc89697cc42179337d338a51035e Reviewed-by: Christian Kandeler --- src/lib/corelib/parser/qmljslexer.cpp | 8 ++++---- src/lib/corelib/tools/shellutils.cpp | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src/lib') diff --git a/src/lib/corelib/parser/qmljslexer.cpp b/src/lib/corelib/parser/qmljslexer.cpp index 815f1ef0d..f8e83c338 100644 --- a/src/lib/corelib/parser/qmljslexer.cpp +++ b/src/lib/corelib/parser/qmljslexer.cpp @@ -237,10 +237,10 @@ int Lexer::lex() bool Lexer::isUnicodeEscapeSequence(const QChar *chars) { - if (isHexDigit(chars[0]) && isHexDigit(chars[1]) && isHexDigit(chars[2]) && isHexDigit(chars[3])) - return true; - - return false; + return isHexDigit(chars[0]) + && isHexDigit(chars[1]) + && isHexDigit(chars[2]) + && isHexDigit(chars[3]); } QChar Lexer::decodeUnicodeEscapeCharacter(bool *ok) diff --git a/src/lib/corelib/tools/shellutils.cpp b/src/lib/corelib/tools/shellutils.cpp index dae98f337..b60881012 100644 --- a/src/lib/corelib/tools/shellutils.cpp +++ b/src/lib/corelib/tools/shellutils.cpp @@ -66,9 +66,7 @@ QString shellInterpreter(const QString &filePath) { inline static bool isSpecialChar(ushort c, const uchar (&iqm)[16]) { - if ((c < sizeof(iqm) * 8) && (iqm[c / 8] & (1 << (c & 7)))) - return true; - return false; + return (c < sizeof(iqm) * 8) && (iqm[c / 8] & (1 << (c & 7))); } inline static bool hasSpecialChars(const QString &arg, const uchar (&iqm)[16]) -- cgit v1.2.3