Replace Match() to operator==() from std::string.

No functional change.
This commit is contained in:
Slava Semushin 2009-07-27 16:25:41 +07:00
parent 5ce151983e
commit 65d6bce165
3 changed files with 4 additions and 6 deletions

View File

@ -713,7 +713,7 @@ void CheckClass::virtualDestructor()
base = Token::findmatch(base->next(), (std::string("%any% ~ ") + baseName[0] + " (").c_str());
const Token *reverseTok = base;
while (Token::Match(base, "%var%") && !Token::Match(base, "virtual"))
while (Token::Match(base, "%var%") && base->str() != "virtual")
base = base->previous();
// Check that there is a destructor..

View File

@ -946,8 +946,7 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::list<const Toke
{
int tokIdx = matchFirst ? 2 : 3;
while (Token::simpleMatch(tok->tokAt(tokIdx), ".") &&
Token::Match(tok->tokAt(tokIdx + 1), "%var%"))
while (Token::Match(tok->tokAt(tokIdx), ". %var%"))
tokIdx += 2;
if (Token::simpleMatch(tok->tokAt(tokIdx), ") ("))

View File

@ -158,8 +158,7 @@ void CheckOther::warningRedundantCode()
}
}
if (Token::simpleMatch(tok2, "this .") ||
Token::Match(tok2, "%var% ::"))
if (Token::Match(tok2, "%var% ::|."))
{
tok2 = tok2->tokAt(2);
}
@ -1056,7 +1055,7 @@ void CheckOther::nullPointer()
// Reassignment of the struct
else if (tok2->varId() == varid1)
{
if (Token::Match(tok2->next(), "="))
if (tok2->next()->str() == "=")
break;
if (Token::Match(tok2->tokAt(-2), "[,(] &"))
break;