tokenize: Replace a complicated condition with a "Match"

This commit is contained in:
Daniel Marjamäki 2008-12-05 19:17:25 +00:00
parent b029163cdc
commit f7a846e31e
1 changed files with 1 additions and 5 deletions

View File

@ -765,11 +765,7 @@ void Tokenizer::simplifyTokenList()
}
// (1-2)
if (strchr("[,(=<>",tok->aaaa0()) &&
(tok->tokAt(1) && tok->tokAt(1)->isNumber()) &&
strchr("+-*/",*(tok->strAt(2))) &&
(tok->tokAt(3) && tok->tokAt(3)->isNumber()) &&
strchr("],);=<>",*(tok->strAt(4))) )
if (TOKEN::Match(tok, "[[,(=<>] %num% [+-*/] %num% [],);=<>]"))
{
int i1 = atoi(tok->strAt(1));
int i2 = atoi(tok->strAt(3));