From 541e255159b00eacbf868edd3c9c54b7d172dfba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 8 Apr 2018 08:12:56 +0200 Subject: [PATCH] Remove inner identical condition --- lib/checkio.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/checkio.cpp b/lib/checkio.cpp index a473e8d1a..3d1111c1a 100644 --- a/lib/checkio.cpp +++ b/lib/checkio.cpp @@ -1230,19 +1230,15 @@ void CheckIO::checkFormatString(const Token * const tok, // If the next character is the same (which makes 'hh' or 'll') then expect another alphabetical character const bool isSecondCharAvailable = ((i + 1) != formatString.end()); if (i != formatString.end() && isSecondCharAvailable && *(i + 1) == *i) { - if (isSecondCharAvailable) { - if (!isalpha(*(i + 2))) { - std::string modifier; - modifier += *i; - modifier += *(i + 1); - invalidLengthModifierError(tok, numFormat, modifier); - done = true; - } else { - specifier = *i++; - specifier += *i++; - } - } else { + if (!isalpha(*(i + 2))) { + std::string modifier; + modifier += *i; + modifier += *(i + 1); + invalidLengthModifierError(tok, numFormat, modifier); done = true; + } else { + specifier = *i++; + specifier += *i++; } } else { if (i != formatString.end()) {