Refactoring: Use continue in loop
This commit is contained in:
parent
2d4f64027a
commit
32940c023a
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue