From 3158e32b7cd5e03b026301367fe2139b55363ea2 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Sat, 1 Aug 2009 21:37:24 +0700 Subject: [PATCH] src/checkstl.cpp(iterators): some corrections. Corrections for my changes in 12ca70fe5a61fa9a7b847411ca23329c52544402 and 347802f81983bf94494c50bd71522f5c5d8f1e15 commits. --- src/checkstl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/checkstl.cpp b/src/checkstl.cpp index 4f121b762..52d25f841 100644 --- a/src/checkstl.cpp +++ b/src/checkstl.cpp @@ -64,7 +64,7 @@ void CheckStl::iterators() if (Token::Match(tok2, "%varid% != %var% . end ( )", iteratorId) && tok2->tokAt(2)->varId() != containerId) { iteratorsError(tok2, tok->strAt(2), tok2->strAt(2)); - tok2 = tok2->tokAt(7); + tok2 = tok2->tokAt(6); } else if (Token::Match(tok2, "%var% . insert|erase ( %varid%", iteratorId)) { @@ -73,17 +73,17 @@ void CheckStl::iterators() else if (tok2->strAt(2) == std::string("erase")) validIterator = false; - tok2 = tok2->tokAt(5); + tok2 = tok2->tokAt(4); } else if (!validIterator && Token::Match(tok2, "* %varid%", iteratorId)) { dereferenceErasedError(tok2, tok2->strAt(1)); - tok2 = tok2->tokAt(2); + tok2 = tok2->next(); } else if (!validIterator && Token::Match(tok2, "%varid% . %var%", iteratorId)) { dereferenceErasedError(tok2, tok2->strAt(0)); - tok2 = tok2->tokAt(3); + tok2 = tok2->tokAt(2); } } }