Skip to content

Commit 298021a

Browse files
Dmitry-Medanmar
authored andcommitted
Remove redundant variable and manipulation thereof
1 parent 9497732 commit 298021a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/checkstl.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -512,12 +512,8 @@ void CheckStl::erase()
512512
const Token *decltok = variableInfo ? variableInfo->typeEndToken() : nullptr;
513513

514514
// Is variable an iterator?
515-
bool isIterator = false;
516-
if (decltok && Token::Match(decltok->tokAt(-2), "> :: iterator %varid%", tok2->next()->varId()))
517-
isIterator = true;
518-
519515
// If tok2->next() is an iterator, check scope
520-
if (isIterator)
516+
if (decltok && Token::Match(decltok->tokAt(-2), "> :: iterator %varid%", tok2->next()->varId()))
521517
EraseCheckLoop::checkScope(this, tok2->next());
522518
}
523519
break;

0 commit comments

Comments
 (0)