@@ -1640,37 +1640,27 @@ void CheckStl::missingComparison()
16401640 bool bComparedInAdvance = false ;
16411641
16421642 // Parse loop..
1643- for (const Token *tok3 = scope.bodyStart ; tok3 != scope.bodyEnd ; tok3 = tok3->next ())
1644- {
1645- if (tok3->varId () == iteratorId)
1646- {
1647- if (Token::Match (tok3, " %varid% = %name% . insert ( ++| %varid% ++| ," , iteratorId))
1648- {
1643+ for (const Token *tok3 = scope.bodyStart ; tok3 != scope.bodyEnd ; tok3 = tok3->next ()) {
1644+ if (tok3->varId () == iteratorId) {
1645+ if (Token::Match (tok3, " %varid% = %name% . insert ( ++| %varid% ++| ," , iteratorId)) {
16491646 // skip insertion..
16501647 tok3 = tok3->linkAt (6 );
16511648 if (!tok3)
16521649 break ;
1653- }
1654- else if (Token::simpleMatch (tok3->astParent (), " ++" ))
1655- {
1650+ } else if (Token::simpleMatch (tok3->astParent (), " ++" )) {
16561651 if (!bComparedInAdvance)
16571652 incrementToken = tok3;
16581653 else
16591654 bComparedInAdvance = false ;
1660- }
1661- else if (Token::simpleMatch (tok3->astParent (), " +" ))
1662- {
1663- if (Token::simpleMatch (tok3->astSibling (), " 1" ))
1664- {
1655+ } else if (Token::simpleMatch (tok3->astParent (), " +" )) {
1656+ if (Token::simpleMatch (tok3->astSibling (), " 1" )) {
16651657 const Token* tokenGrandParent = tok3->astParent ()->astParent ();
16661658 if (Token::Match (tokenGrandParent, " ==|!=" ))
16671659 bComparedInAdvance = true ;
16681660 }
1669- }
1670- else if (Token::Match (tok3->astParent (), " ==|!=" ))
1661+ } else if (Token::Match (tok3->astParent (), " ==|!=" ))
16711662 incrementToken = nullptr ;
1672- }
1673- else if (tok3->str () == " break" || tok3->str () == " return" )
1663+ } else if (tok3->str () == " break" || tok3->str () == " return" )
16741664 incrementToken = nullptr ;
16751665 }
16761666 if (incrementToken)
0 commit comments