Refactoring: Use continue in loop

This commit is contained in:
Daniel Marjamäki 2017-07-26 21:13:49 +02:00
parent 32940c023a
commit da26ef0650
1 changed files with 26 additions and 26 deletions

View File

@ -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;
} }
} }