Refactor loop, use continue

This commit is contained in:
Daniel Marjamäki 2017-07-26 22:03:55 +02:00
parent da26ef0650
commit a3916c501c
1 changed files with 38 additions and 37 deletions

View File

@ -1304,7 +1304,9 @@ void CheckClass::checkReturnPtrThis(const Scope *scope, const Function *func, co
for (; tok && tok != last; tok = tok->next()) {
// check for return of reference to this
if (tok->str() == "return") {
if (tok->str() != "return")
continue;
foundReturn = true;
std::string cast("( " + scope->className + " & )");
if (Token::simpleMatch(tok->next(), cast.c_str()))
@ -1349,7 +1351,6 @@ void CheckClass::checkReturnPtrThis(const Scope *scope, const Function *func, co
tok->next()->str() == scope->className)))
operatorEqRetRefThisError(func->token);
}
}
if (foundReturn) {
return;
}