Break loop early
This commit is contained in:
parent
d160d27417
commit
2582bbd0f6
|
@ -979,8 +979,10 @@ void CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(const Scope* const
|
||||||
{
|
{
|
||||||
const Token *parent = tok->astParent();
|
const Token *parent = tok->astParent();
|
||||||
while (parent) {
|
while (parent) {
|
||||||
if (Token::simpleMatch(parent->previous(), "while ("))
|
if (Token::simpleMatch(parent->previous(), "while (")) {
|
||||||
inwhile = true;
|
inwhile = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
parent = parent->astParent();
|
parent = parent->astParent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue