From 321106c39e2bd490d66825d333a3d3047ab74cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 25 Jul 2009 19:36:57 +0200 Subject: [PATCH] speedup of CheckOther::postIncrement --- src/checkother.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/checkother.cpp b/src/checkother.cpp index 6ecd12ba8..cb50d8bc7 100644 --- a/src/checkother.cpp +++ b/src/checkother.cpp @@ -1128,11 +1128,11 @@ void CheckOther::postIncrement() { for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) { - if (!Token::simpleMatch(tok, "for (")) - continue; - - for (const Token *tok2 = tok; tok2; tok2 = tok2->next()) + if (Token::simpleMatch(tok, "for (")) { + const Token *tok2 = tok->next()->link(); + if (tok2) + tok2 = tok2->tokAt(-3); if (Token::Match(tok2, "; %var% ++|-- )")) { // Take a look at the variable declaration