This commit is contained in:
Edoardo Prezioso 2012-11-07 18:34:25 +01:00
parent 061a5e1ad7
commit 9556634ee7
2 changed files with 2 additions and 2 deletions

View File

@ -816,7 +816,7 @@ bool TemplateSimplifier::simplifyCalculations(Token *_tokens)
if (tok->isNumber()) {
// Remove redundant conditions (0&&x) (1||x)
if (Token::Match(tok->previous(), "[(=,] 0 &&") ||
Token::Match(tok->previous(), "[(=,] 1 %oror%")) {
Token::Match(tok->previous(), "[(=,] 1 ||")) {
unsigned int par = 0;
const Token *tok2 = tok;
for (; tok2; tok2 = tok2->next()) {

View File

@ -5653,7 +5653,7 @@ bool Tokenizer::simplifyLogicalOperators()
} else if (Token::Match(tok, "&& not|compl %var%")) {
tok->next()->str(tok->next()->str() == "not" ? "!" : "~");
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" ? "!" : "~");
ret = true;
}