Skip to content

Commit 541e255

Browse files
committed
Remove inner identical condition
1 parent 9098330 commit 541e255

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

lib/checkio.cpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,19 +1230,15 @@ void CheckIO::checkFormatString(const Token * const tok,
12301230
// If the next character is the same (which makes 'hh' or 'll') then expect another alphabetical character
12311231
const bool isSecondCharAvailable = ((i + 1) != formatString.end());
12321232
if (i != formatString.end() && isSecondCharAvailable && *(i + 1) == *i) {
1233-
if (isSecondCharAvailable) {
1234-
if (!isalpha(*(i + 2))) {
1235-
std::string modifier;
1236-
modifier += *i;
1237-
modifier += *(i + 1);
1238-
invalidLengthModifierError(tok, numFormat, modifier);
1239-
done = true;
1240-
} else {
1241-
specifier = *i++;
1242-
specifier += *i++;
1243-
}
1244-
} else {
1233+
if (!isalpha(*(i + 2))) {
1234+
std::string modifier;
1235+
modifier += *i;
1236+
modifier += *(i + 1);
1237+
invalidLengthModifierError(tok, numFormat, modifier);
12451238
done = true;
1239+
} else {
1240+
specifier = *i++;
1241+
specifier += *i++;
12461242
}
12471243
} else {
12481244
if (i != formatString.end()) {

0 commit comments

Comments
 (0)