Use temp variable to omit recomputing the same value.

This commit is contained in:
Dmitry-Me 2014-07-17 10:44:19 +04:00
parent d3425d5c61
commit c829dff2b9
1 changed files with 2 additions and 1 deletions

View File

@ -108,7 +108,8 @@ static bool variableIsUsedInScope(const Token* start, unsigned int varId, const
for (const Token *tok = start; tok && tok != scope->classEnd; tok = tok->next()) {
if (tok->varId() == varId)
return true;
if (tok->scope()->type == Scope::eFor || tok->scope()->type == Scope::eDo || tok->scope()->type == Scope::eWhile) // In case of loops, better checking would be necessary
const Scope::ScopeType scopeType = tok->scope()->type;
if (scopeType == Scope::eFor || scopeType == Scope::eDo || scopeType == Scope::eWhile) // In case of loops, better checking would be necessary
return true;
if (Token::simpleMatch(tok, "asm ("))
return true;