Reorder checks, unwrap code

This commit is contained in:
Dmitry-Me 2014-09-16 10:17:06 +04:00
parent b479948f0f
commit 6f9730b1d8
1 changed files with 2 additions and 2 deletions

View File

@ -1233,7 +1233,7 @@ static bool valueFlowForLoop1(const Token *tok, unsigned int * const varid, Math
tok = tok->tokAt(2);
if (!Token::Match(tok,"%type%| %var% ="))
return false;
const Token * const vartok = tok->tokAt(Token::Match(tok, "%var% =") ? 0 : 1);
const Token * const vartok = Token::Match(tok, "%var% =") ? tok : tok->next();
if (vartok->varId() == 0U)
return false;
*varid = vartok->varId();
@ -1492,7 +1492,7 @@ static void valueFlowSubFunction(TokenList *tokenlist, ErrorLogger *errorLogger,
std::list<ValueFlow::Value> argvalues;
// passing value(s) to function
if (Token::Match(argtok, "%var%|%num%|%str% [,)]") && !argtok->values.empty())
if (!argtok->values.empty() && Token::Match(argtok, "%var%|%num%|%str% [,)]"))
argvalues = argtok->values;
else {
// bool operator => values 1/0 are passed to function..