tokenize: Replace a complicated condition with a "Match"
This commit is contained in:
parent
b029163cdc
commit
f7a846e31e
|
@ -765,11 +765,7 @@ void Tokenizer::simplifyTokenList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// (1-2)
|
// (1-2)
|
||||||
if (strchr("[,(=<>",tok->aaaa0()) &&
|
if (TOKEN::Match(tok, "[[,(=<>] %num% [+-*/] %num% [],);=<>]"))
|
||||||
(tok->tokAt(1) && tok->tokAt(1)->isNumber()) &&
|
|
||||||
strchr("+-*/",*(tok->strAt(2))) &&
|
|
||||||
(tok->tokAt(3) && tok->tokAt(3)->isNumber()) &&
|
|
||||||
strchr("],);=<>",*(tok->strAt(4))) )
|
|
||||||
{
|
{
|
||||||
int i1 = atoi(tok->strAt(1));
|
int i1 = atoi(tok->strAt(1));
|
||||||
int i2 = atoi(tok->strAt(3));
|
int i2 = atoi(tok->strAt(3));
|
||||||
|
|
Loading…
Reference in New Issue