Revert 1c0617c504
.
This commit is contained in:
parent
061a5e1ad7
commit
9556634ee7
|
@ -816,7 +816,7 @@ bool TemplateSimplifier::simplifyCalculations(Token *_tokens)
|
||||||
if (tok->isNumber()) {
|
if (tok->isNumber()) {
|
||||||
// Remove redundant conditions (0&&x) (1||x)
|
// Remove redundant conditions (0&&x) (1||x)
|
||||||
if (Token::Match(tok->previous(), "[(=,] 0 &&") ||
|
if (Token::Match(tok->previous(), "[(=,] 0 &&") ||
|
||||||
Token::Match(tok->previous(), "[(=,] 1 %oror%")) {
|
Token::Match(tok->previous(), "[(=,] 1 ||")) {
|
||||||
unsigned int par = 0;
|
unsigned int par = 0;
|
||||||
const Token *tok2 = tok;
|
const Token *tok2 = tok;
|
||||||
for (; tok2; tok2 = tok2->next()) {
|
for (; tok2; tok2 = tok2->next()) {
|
||||||
|
|
|
@ -5653,7 +5653,7 @@ bool Tokenizer::simplifyLogicalOperators()
|
||||||
} else if (Token::Match(tok, "&& not|compl %var%")) {
|
} else if (Token::Match(tok, "&& not|compl %var%")) {
|
||||||
tok->next()->str(tok->next()->str() == "not" ? "!" : "~");
|
tok->next()->str(tok->next()->str() == "not" ? "!" : "~");
|
||||||
ret = true;
|
ret = true;
|
||||||
} else if (Token::Match(tok, "%oror% not|compl %var%")) {
|
} else if (Token::Match(tok, "|| not|compl %var%")) {
|
||||||
tok->next()->str(tok->next()->str() == "not" ? "!" : "~");
|
tok->next()->str(tok->next()->str() == "not" ? "!" : "~");
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue