Omit redundant token match
This commit is contained in:
parent
a8f10735b1
commit
5517c22524
|
@ -1332,7 +1332,7 @@ bool CheckUninitVar::checkScopeForVariable(const Token *tok, const Variable& var
|
||||||
for (const Token *tok2 = tok; tok2 && tok2 != tok->link(); tok2 = tok2->next()) {
|
for (const Token *tok2 = tok; tok2 && tok2 != tok->link(); tok2 = tok2->next()) {
|
||||||
if (Token::Match(tok2, "[;{}.] %var% = - %name% ;"))
|
if (Token::Match(tok2, "[;{}.] %var% = - %name% ;"))
|
||||||
varValueElse[tok2->next()->varId()] = NOT_ZERO;
|
varValueElse[tok2->next()->varId()] = NOT_ZERO;
|
||||||
if (Token::Match(tok2, "[;{}.] %var% = %num% ;"))
|
else if (Token::Match(tok2, "[;{}.] %var% = %num% ;"))
|
||||||
varValueElse[tok2->next()->varId()] = (int)MathLib::toLongNumber(tok2->strAt(3));
|
varValueElse[tok2->next()->varId()] = (int)MathLib::toLongNumber(tok2->strAt(3));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue