Tokenizer(simplifyNot): replace "if" by "else if" and added braces.
No functional change.
This commit is contained in:
parent
b5c6d7ba49
commit
0582572867
|
@ -2833,12 +2833,18 @@ bool Tokenizer::simplifyNot()
|
||||||
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%"))
|
||||||
|
{
|
||||||
tok->tokAt(2)->str("!");
|
tok->tokAt(2)->str("!");
|
||||||
if (Token::Match(tok, "&& not %var%"))
|
}
|
||||||
|
else if (Token::Match(tok, "&& not %var%"))
|
||||||
|
{
|
||||||
tok->next()->str("!");
|
tok->next()->str("!");
|
||||||
if (Token::Match(tok, "|| not %var%"))
|
}
|
||||||
|
else if (Token::Match(tok, "|| not %var%"))
|
||||||
|
{
|
||||||
tok->next()->str("!");
|
tok->next()->str("!");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue