Tokenizer::setVarId(): simplify code a bit.

No functional change.
This commit is contained in:
Slava Semushin 2009-08-30 03:25:14 +07:00
parent 6bb6cbadc2
commit d3118d85c0
1 changed files with 2 additions and 2 deletions

View File

@ -937,10 +937,10 @@ void Tokenizer::setVarId()
{ {
++_varId; ++_varId;
const std::string pattern(std::string(". ") + tok->strAt(2)); const std::string pattern(std::string("%varid% . ") + tok->strAt(2));
for (Token *tok2 = tok; tok2; tok2 = tok2->next()) for (Token *tok2 = tok; tok2; tok2 = tok2->next())
{ {
if (tok2->varId() == tok->varId() && Token::simpleMatch(tok2->next(), pattern.c_str())) if (Token::Match(tok2, pattern.c_str(), tok->varId()))
tok2->tokAt(2)->varId(_varId); tok2->tokAt(2)->varId(_varId);
} }
} }