diff --git a/lib/templatesimplifier.cpp b/lib/templatesimplifier.cpp index e885b7326..4675148c1 100644 --- a/lib/templatesimplifier.cpp +++ b/lib/templatesimplifier.cpp @@ -1243,12 +1243,8 @@ bool TemplateSimplifier::simplifyNumericCalculations(Token *tok) // should be moved away. bool TemplateSimplifier::simplifyCalculations(Token *_tokens) { - bool ret = false, goback = false; + bool ret = false; for (Token *tok = _tokens; tok; tok = tok->next()) { - if (goback) { - tok = tok->previous(); - goback = false; - } // Remove parentheses around variable.. // keep parentheses here: dynamic_cast(p); // keep parentheses here: A operator * (int); @@ -1405,7 +1401,7 @@ bool TemplateSimplifier::simplifyCalculations(Token *_tokens) tok->str(result); tok->deleteNext(2); ret = true; - goback = true; + tok = tok->previous(); } } }