Optimising: Tokenizer::setVarId when setting variable ids for struct/class members
This commit is contained in:
parent
195b48e81f
commit
6a3befa720
|
@ -2875,11 +2875,14 @@ void Tokenizer::setVarId()
|
|||
{
|
||||
++_varId;
|
||||
|
||||
const std::string pattern(std::string("%varid% . ") + tok->strAt(2));
|
||||
const std::string pattern(std::string(". ") + tok->strAt(2));
|
||||
for (Token *tok2 = tok; tok2; tok2 = tok2->next())
|
||||
{
|
||||
if (Token::Match(tok2, pattern.c_str(), tok->varId()))
|
||||
tok2->tokAt(2)->varId(_varId);
|
||||
if (tok2->varId() == tok->varId())
|
||||
{
|
||||
if (Token::Match(tok2->next(), pattern.c_str()))
|
||||
tok2->tokAt(2)->varId(_varId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue