Break loop early

This commit is contained in:
Dmitry-Me 2015-02-04 10:47:58 +03:00
parent 323475393b
commit 1f31dd749b
1 changed files with 3 additions and 2 deletions

View File

@ -1742,9 +1742,10 @@ void CheckOther::checkIncompleteStatement()
// bailout if there is a "? :" in this statement
bool bailout = false;
for (const Token *tok2 = tok->tokAt(2); tok2; tok2 = tok2->next()) {
if (tok2->str() == "?")
if (tok2->str() == "?") {
bailout = true;
else if (tok2->str() == ";")
break;
} else if (tok2->str() == ";")
break;
}
if (bailout)