Tokenizer::simplifyLogicalOperators(): change return type to void.
No functional change.
This commit is contained in:
parent
9d7defad22
commit
6f93182580
|
@ -2819,11 +2819,10 @@ bool Tokenizer::simplifyIfNotNull()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Tokenizer::simplifyLogicalOperators()
|
void Tokenizer::simplifyLogicalOperators()
|
||||||
{
|
{
|
||||||
// "if (not p)" => "if (!p)"
|
// "if (not p)" => "if (!p)"
|
||||||
// "if (p and q)" => "if (p and q)"
|
// "if (p and q)" => "if (p and q)"
|
||||||
bool ret = false;
|
|
||||||
for (Token *tok = _tokens; tok; tok = tok->next())
|
for (Token *tok = _tokens; tok; tok = tok->next())
|
||||||
{
|
{
|
||||||
if (Token::Match(tok, "if|while ( not %var%"))
|
if (Token::Match(tok, "if|while ( not %var%"))
|
||||||
|
@ -2846,7 +2845,6 @@ bool Tokenizer::simplifyLogicalOperators()
|
||||||
tok->str("&&");
|
tok->str("&&");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -167,10 +167,8 @@ private:
|
||||||
* Examples:
|
* Examples:
|
||||||
* "if (not p)" => "if (!p)"
|
* "if (not p)" => "if (!p)"
|
||||||
* "if (p and q)" => "if (p && q)"
|
* "if (p and q)" => "if (p && q)"
|
||||||
* @return true if something is modified
|
|
||||||
* false if nothing is done.
|
|
||||||
*/
|
*/
|
||||||
bool simplifyLogicalOperators();
|
void simplifyLogicalOperators();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simplify comma into a semicolon when possible
|
* Simplify comma into a semicolon when possible
|
||||||
|
|
Loading…
Reference in New Issue