Refactoring, use early continue in loop

This commit is contained in:
Daniel Marjamäki 2017-09-21 22:53:15 +02:00
parent 411c5e5f7e
commit 5e618418d5
1 changed files with 32 additions and 31 deletions

View File

@ -1579,7 +1579,9 @@ void CheckOther::checkIncompleteStatement()
tok = tok->link();
else if (Token::Match(tok, "[;{}] %str%|%num%")) {
if (!Token::Match(tok, "[;{}] %str%|%num%"))
continue;
// No warning if numeric constant is followed by a "." or ","
if (Token::Match(tok->next(), "%num% [,.]"))
continue;
@ -1615,7 +1617,6 @@ void CheckOther::checkIncompleteStatement()
constStatementError(tok->next(), tok->next()->isNumber() ? "numeric" : "string");
}
}
}
void CheckOther::constStatementError(const Token *tok, const std::string &type)
{