valueFlowLifetime: Try to cleanup the loop a little. No functional change is intended.
This commit is contained in:
parent
5a6f9ac82a
commit
0ad757fc78
|
@ -1168,14 +1168,8 @@ static void valueFlowTerminatingCondition(TokenList *tokenlist, SymbolDatabase*
|
||||||
for (Condition cond:conds) {
|
for (Condition cond:conds) {
|
||||||
if (!cond.first)
|
if (!cond.first)
|
||||||
continue;
|
continue;
|
||||||
for (Token* tok = cond.first->next(); tok != scope->bodyEnd; tok = tok->next()) {
|
Token *const startToken = cond.first->findExpressionStartEndTokens().second->next();
|
||||||
if (tok == cond.first)
|
for (Token* tok = startToken; tok != scope->bodyEnd; tok = tok->next()) {
|
||||||
continue;
|
|
||||||
const Token *tokParent = tok->astParent();
|
|
||||||
while (tokParent && tokParent != cond.first)
|
|
||||||
tokParent = tokParent->astParent();
|
|
||||||
if (tokParent == cond.first)
|
|
||||||
continue;
|
|
||||||
if (!Token::Match(tok, "%comp%"))
|
if (!Token::Match(tok, "%comp%"))
|
||||||
continue;
|
continue;
|
||||||
// Skip known values
|
// Skip known values
|
||||||
|
|
Loading…
Reference in New Issue