src/checkstl.cpp(iterators): simplify condition.
This commit is contained in:
parent
46a386ba83
commit
a1a4577a7c
|
@ -60,9 +60,9 @@ void CheckStl::iterators()
|
||||||
{
|
{
|
||||||
if (tok2->str() == "}")
|
if (tok2->str() == "}")
|
||||||
break;
|
break;
|
||||||
if (tok2->varId() == iteratorId)
|
|
||||||
|
if (Token::Match(tok2, "%varid% != %var% . end ( )", iteratorId) && tok2->tokAt(2)->varId() != containerId)
|
||||||
{
|
{
|
||||||
if (Token::Match(tok2->next(), "!= %var% . end ( )") && tok2->tokAt(2)->varId() != containerId)
|
|
||||||
iteratorsError(tok2, tok->strAt(2), tok2->strAt(2));
|
iteratorsError(tok2, tok->strAt(2), tok2->strAt(2));
|
||||||
}
|
}
|
||||||
else if (Token::Match(tok2, "%var% . insert|erase ( %varid%", iteratorId))
|
else if (Token::Match(tok2, "%var% . insert|erase ( %varid%", iteratorId))
|
||||||
|
|
Loading…
Reference in New Issue