Refactoring TemplateSimplifier::simplifyCalculations, Token::Match patterns

This commit is contained in:
Daniel Marjamäki 2017-06-08 08:18:40 +02:00
parent c1ea873e1c
commit da87fdbb90
1 changed files with 2 additions and 4 deletions

View File

@ -1095,11 +1095,9 @@ bool TemplateSimplifier::simplifyCalculations(Token *_tokens)
tok = tok->previous();
tok->deleteNext(2);
ret = true;
} else if (Token::Match(tok->previous(), "[=[(,] 0 * %name% ,|]|)|;|=|%cop%") ||
Token::Match(tok->previous(), "[=[(,] 0 * %num% ,|]|)|;|%op%") ||
} else if (Token::Match(tok->previous(), "[=[(,] 0 * %name%|%num% ,|]|)|;|=|%cop%") ||
Token::Match(tok->previous(), "[=[(,] 0 * (") ||
Token::Match(tok->previous(), "return|case 0 *|&& %name% ,|:|;|=|%cop%") ||
Token::Match(tok->previous(), "return|case 0 *|&& %num% ,|:|;|%op%") ||
Token::Match(tok->previous(), "return|case 0 *|&& %name%|%num% ,|:|;|=|%cop%") ||
Token::Match(tok->previous(), "return|case 0 *|&& (")) {
tok->deleteNext();
if (tok->next()->str() == "(")