Replaced two Token::simpleMatch() calls to one Token::Match().
Suggested by hyd_danmar in ticket http://apps.sourceforge.net/trac/cppcheck/ticket/323 No functional change.
This commit is contained in:
parent
a2a6eebb01
commit
0f20ce738d
|
@ -120,7 +120,7 @@ void CheckFunctionUsage::parseTokens(const Tokenizer &tokenizer)
|
|||
else if (tok2->str() == ")")
|
||||
{
|
||||
--parlevel;
|
||||
if (parlevel == 0 && (Token::simpleMatch(tok2, ") {") || Token::simpleMatch(tok2, ") const")))
|
||||
if (parlevel == 0 && (Token::Match(tok2, ") const|{")))
|
||||
funcname = NULL;
|
||||
if (parlevel <= 0)
|
||||
break;
|
||||
|
|
|
@ -1206,7 +1206,7 @@ void CheckMemoryLeakClass::simplifycode(Token *tok, bool &all)
|
|||
erase(tok2, tok2->tokAt(2));
|
||||
tok2 = tok2->next();
|
||||
bool first = true;
|
||||
while (Token::simpleMatch(tok2, "case") || Token::simpleMatch(tok2, "default"))
|
||||
while (Token::Match(tok2, "case|default"))
|
||||
{
|
||||
bool def = Token::simpleMatch(tok2, "default");
|
||||
tok2->str(first ? "if" : "}");
|
||||
|
|
|
@ -1171,8 +1171,7 @@ void Tokenizer::simplifyTokenList()
|
|||
tempToken = tempToken->tokAt(2);
|
||||
continue;
|
||||
}
|
||||
else if (Token::simpleMatch(tempToken->next(), "++") ||
|
||||
Token::simpleMatch(tempToken->next(), "--"))
|
||||
else if (Token::Match(tempToken->next(), "++|--"))
|
||||
{
|
||||
// We have variable++ or variable--, there should be
|
||||
// nothing after this
|
||||
|
|
Loading…
Reference in New Issue