diff --git a/src/tokenize.cpp b/src/tokenize.cpp index cbb023fb6..8af0bd6f1 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -3556,9 +3556,8 @@ void Tokenizer::syntaxError(const Token *tok, char c) } -bool Tokenizer::simplifyComma() +void Tokenizer::simplifyComma() { - bool ret = false; for (Token *tok = _tokens; tok; tok = tok->next()) { if (Token::simpleMatch(tok, "for (") || @@ -3580,7 +3579,6 @@ bool Tokenizer::simplifyComma() { // Handle "delete a, delete b;" tok->str(";"); - ret = true; } if (tok->previous() && tok->previous()->previous()) @@ -3591,7 +3589,6 @@ bool Tokenizer::simplifyComma() // Handle "delete a, b;" tok->str(";"); tok->insertToken("delete"); - ret = true; } else { @@ -3601,7 +3598,6 @@ bool Tokenizer::simplifyComma() { // Handle "a = 0, b = 0;" tok->str(";"); - ret = true; break; } else if (Token::Match(tok2, "delete %var%") || @@ -3609,7 +3605,6 @@ bool Tokenizer::simplifyComma() { // Handle "delete a, a = 0;" tok->str(";"); - ret = true; break; } else if (Token::Match(tok2, "[;,{}()]")) @@ -3705,11 +3700,8 @@ bool Tokenizer::simplifyComma() startFrom->previous()->deleteThis(); tok = endAt; - ret = true; } } } - - return ret; } diff --git a/src/tokenize.h b/src/tokenize.h index 921c529b9..fc1a43c52 100644 --- a/src/tokenize.h +++ b/src/tokenize.h @@ -167,10 +167,8 @@ private: * Example: "delete a, delete b" => "delete a; delete b;" * Example: "a = 0, b = 0;" => "a = 0; b = 0;" * Example: "return a(), b;" => "a(); return b;" - * @return true if something is modified - * false if nothing is done. */ - bool simplifyComma(); + void simplifyComma(); /** Add braces to an if-block * @return true if something is modified