File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1857,7 +1857,7 @@ void CheckStlImpl::redundantCondition()
18571857 continue ;
18581858
18591859 const Token* tok = scope.classDef ->tokAt (2 );
1860- if (!Token::Match (tok, " %name% . find ( %any% ) != %name% . end|rend|cend|crend ( ) ) { %name% . remove| erase ( %any% ) ;" ))
1860+ if (!Token::Match (tok, " %name% . find ( %any% ) != %name% . end|rend|cend|crend ( ) ) { %name% . erase ( %any% ) ;" ))
18611861 continue ;
18621862
18631863 // Get tokens for the fields %name% and %any%
@@ -1867,6 +1867,9 @@ void CheckStlImpl::redundantCondition()
18671867 const Token *var3 = var2->tokAt (7 );
18681868 const Token *any2 = var3->tokAt (4 );
18691869
1870+ if (any2->tokAt (3 ) != scope.bodyEnd )
1871+ continue ;
1872+
18701873 // Check if all the "%name%" fields are the same and if all the "%any%" are the same..
18711874 if (var1->str () == var2->str () &&
18721875 var2->str () == var3->str () &&
You can’t perform that action at this time.
0 commit comments