Refactor loop, use continue
This commit is contained in:
parent
da26ef0650
commit
a3916c501c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue