Use temp variable to omit recomputing the same value.
This commit is contained in:
parent
d3425d5c61
commit
c829dff2b9
|
@ -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()) {
|
for (const Token *tok = start; tok && tok != scope->classEnd; tok = tok->next()) {
|
||||||
if (tok->varId() == varId)
|
if (tok->varId() == varId)
|
||||||
return true;
|
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;
|
return true;
|
||||||
if (Token::simpleMatch(tok, "asm ("))
|
if (Token::simpleMatch(tok, "asm ("))
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue