use early continue

This commit is contained in:
Daniel Marjamäki 2018-03-12 12:50:33 +01:00
parent c0e14d0a5d
commit 31dd4ed787
1 changed files with 13 additions and 13 deletions

View File

@ -292,7 +292,8 @@ void CheckSizeof::sizeofCalculation()
const bool printInconclusive = _settings->inconclusive;
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) {
if (Token::simpleMatch(tok, "sizeof (")) {
if (!Token::simpleMatch(tok, "sizeof ("))
continue;
// ignore if the `sizeof` result is cast to void inside a macro, i.e. the calculation is
// expected to be parsed but skipped, such as in a disabled custom ASSERT() macro
@ -309,7 +310,6 @@ void CheckSizeof::sizeofCalculation()
sizeofCalculationError(argument, argument->isExpandedMacro());
}
}
}
void CheckSizeof::sizeofCalculationError(const Token *tok, bool inconclusive)
{