Simplify code with temporary

This commit is contained in:
Dmitry-Me 2017-09-12 07:46:38 +03:00
parent caebf137bc
commit 4126fab1d5
1 changed files with 2 additions and 1 deletions

View File

@ -1247,8 +1247,9 @@ static void valueFlowAST(Token *tok, unsigned int varid, const ValueFlow::Value
if (conditionIsFalse(tok->astOperand1(), pm))
return;
} else if (tok->str() == "||" && tok->astOperand1()) {
const std::list<ValueFlow::Value> &values = tok->astOperand1()->values();
bool nonzero = false;
for (std::list<ValueFlow::Value>::const_iterator it = tok->astOperand1()->values().begin(); it != tok->astOperand1()->values().end(); ++it) {
for (std::list<ValueFlow::Value>::const_iterator it = values.begin(); it != values.end(); ++it) {
nonzero |= (it->intvalue != 0);
}
if (!nonzero)