diff --git a/src/tokenize.cpp b/src/tokenize.cpp index 2c4b90beb..bba161bee 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -2579,10 +2579,8 @@ void Tokenizer::unsignedint() } -bool Tokenizer::simplifyIfAssign() +void Tokenizer::simplifyIfAssign() { - bool ret = false; - for (Token *tok = _tokens; tok; tok = tok->next()) { if (!Token::Match(tok->next(), "if|while ( !| (| %var% =") && @@ -2595,9 +2593,6 @@ bool Tokenizer::simplifyIfAssign() // delete the "if" tok->deleteNext(); - // The tokenlist has changed - ret = true; - // Remember if there is a "!" or not. And delete it if there are. const bool isNot(tok->tokAt(2)->str() == "!"); if (isNot) @@ -2690,8 +2685,6 @@ bool Tokenizer::simplifyIfAssign() } } } - - return ret; } diff --git a/src/tokenize.h b/src/tokenize.h index b0c3efb34..2daee628c 100644 --- a/src/tokenize.h +++ b/src/tokenize.h @@ -138,10 +138,8 @@ private: /** * simplify if-assignments.. * Example: "if(a=b);" => "a=b;if(a);" - * @return true if something is modified - * false if nothing is done. */ - bool simplifyIfAssign(); + void simplifyIfAssign(); /** * simplify if-not..