Proper if-else-if chain for mutually exclusive conditions

This commit is contained in:
Dmitry-Me 2015-03-14 15:09:46 +03:00
parent d8d18ac6dd
commit 89ec9058a8
1 changed files with 1 additions and 1 deletions

View File

@ -1302,7 +1302,7 @@ bool CheckUninitVar::checkScopeForVariable(const Token *tok, const Variable& var
for (const Token *tok2 = tok; tok2 && tok2 != tok->link(); tok2 = tok2->next()) {
if (Token::Match(tok2, "[;{}.] %name% = - %name% ;"))
varValueIf[tok2->next()->varId()] = NOT_ZERO;
if (Token::Match(tok2, "[;{}.] %name% = %num% ;"))
else if (Token::Match(tok2, "[;{}.] %name% = %num% ;"))
varValueIf[tok2->next()->varId()] = (int)MathLib::toLongNumber(tok2->strAt(3));
}
}