From d08d1deab1afb1f0e68fa9d08bd9e580591800a6 Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Tue, 8 Dec 2009 23:12:49 +0200 Subject: [PATCH] Apply patch from #1066 (Speed up cppcheck) http://sourceforge.net/apps/trac/cppcheck/ticket/1066 --- lib/tokenize.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index ded536ef8..66376e66d 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -3539,7 +3539,8 @@ bool Tokenizer::simplifyKnownVariables() // parse the block of code.. int indentlevel = 0; - for (Token *tok2 = tok; tok2; tok2 = tok2->next()) + Token *tok2 = tok; + for (; tok2; tok2 = tok2->next()) { if (tok2->str() == "{") @@ -3696,6 +3697,9 @@ bool Tokenizer::simplifyKnownVariables() } } } + + if (tok2) + tok = tok2->previous(); } return ret;