Refactoring: Use continue in loop
This commit is contained in:
parent
32940c023a
commit
da26ef0650
|
@ -52,12 +52,14 @@ void CheckAssert::assertWithSideEffects()
|
||||||
for (const Token* tmp = tok->next(); tmp != endTok; tmp = tmp->next()) {
|
for (const Token* tmp = tok->next(); tmp != endTok; tmp = tmp->next()) {
|
||||||
checkVariableAssignment(tmp, tok->scope());
|
checkVariableAssignment(tmp, tok->scope());
|
||||||
|
|
||||||
if (tmp->tokType() == Token::eFunction) {
|
if (tmp->tokType() != Token::eFunction)
|
||||||
const Function* f = tmp->function();
|
continue;
|
||||||
|
|
||||||
if (f->nestedIn->isClassOrStruct() && !f->isStatic() && !f->isConst())
|
const Function* f = tmp->function();
|
||||||
|
if (f->nestedIn->isClassOrStruct() && !f->isStatic() && !f->isConst()) {
|
||||||
sideEffectInAssertError(tmp, f->name()); // Non-const member function called
|
sideEffectInAssertError(tmp, f->name()); // Non-const member function called
|
||||||
else {
|
continue;
|
||||||
|
}
|
||||||
const Scope* scope = f->functionScope;
|
const Scope* scope = f->functionScope;
|
||||||
if (!scope) continue;
|
if (!scope) continue;
|
||||||
|
|
||||||
|
@ -85,8 +87,6 @@ void CheckAssert::assertWithSideEffects()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
tok = endTok;
|
tok = endTok;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue