diff --git a/src/tokenize.cpp b/src/tokenize.cpp index 8af0bd6f1..3e85ae2ec 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -1794,10 +1794,8 @@ bool Tokenizer::removeReduntantConditions() return ret; } -bool Tokenizer::simplifyIfAddBraces() +void Tokenizer::simplifyIfAddBraces() { - bool ret = false; - for (Token *tok = _tokens; tok; tok = tok ? tok->next() : NULL) { if (Token::Match(tok, "if|for|while (")) @@ -1834,7 +1832,7 @@ bool Tokenizer::simplifyIfAddBraces() // If there is no code after he if(), abort if (!tok->next()) - return false; + return; // insert open brace.. @@ -1875,11 +1873,8 @@ bool Tokenizer::simplifyIfAddBraces() { tempToken->insertToken("}"); Token::createMutualLinks(tok, tempToken->next()); - ret = true; } } - - return ret; } bool Tokenizer::simplifyDoWhileAddBraces() diff --git a/src/tokenize.h b/src/tokenize.h index fc1a43c52..f12089444 100644 --- a/src/tokenize.h +++ b/src/tokenize.h @@ -171,10 +171,8 @@ private: void simplifyComma(); /** Add braces to an if-block - * @return true if something is modified - * false if nothing is done. */ - bool simplifyIfAddBraces(); + void simplifyIfAddBraces(); /** Add braces to an do-while block * @return true if something is modified