Break the loop once the result can no longer change.
This commit is contained in:
parent
b7d7633b97
commit
454dd0a736
|
@ -81,7 +81,10 @@ void CheckAssert::assertWithSideEffects()
|
|||
|
||||
bool noReturnInScope = true;
|
||||
for (std::vector<const Token*>::iterator rt = returnTokens.begin(); rt != returnTokens.end(); ++rt) {
|
||||
noReturnInScope &= !inSameScope(*rt, tok2);
|
||||
if (!inSameScope(*rt, tok2)) {
|
||||
noReturnInScope = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (noReturnInScope) continue;
|
||||
bool isAssigned = checkVariableAssignment(tok2, false);
|
||||
|
|
Loading…
Reference in New Issue