Refactoring: Use continue in loop

This commit is contained in:
Daniel Marjamäki 2017-07-26 20:32:14 +02:00
parent 2d4f64027a
commit 32940c023a
1 changed files with 45 additions and 45 deletions

View File

@ -1409,7 +1409,8 @@ void CheckStl::checkDereferenceInvalidIterator()
// be an iterator that is dereferenced before being checked for validity.
const std::list<Scope>& scopeList = _tokenizer->getSymbolDatabase()->scopeList;
for (std::list<Scope>::const_iterator i = scopeList.begin(); i != scopeList.end(); ++i) {
if (i->type == Scope::eIf || i->type == Scope::eDo || i->type == Scope::eWhile || i->type == Scope::eFor) {
if (!(i->type == Scope::eIf || i->type == Scope::eDo || i->type == Scope::eWhile || i->type == Scope::eFor))
continue;
const Token* const tok = i->classDef;
const Token* startOfCondition = tok->next();
@ -1460,7 +1461,6 @@ void CheckStl::checkDereferenceInvalidIterator()
dereferenceInvalidIteratorError(dereferenceTok, dereferenceTok->strAt(1));
}
}
}
void CheckStl::dereferenceInvalidIteratorError(const Token* deref, const std::string &iterName)
{