Optimising: Tokenizer::setVarId when setting variable ids for struct/class members
This commit is contained in:
parent
195b48e81f
commit
6a3befa720
|
@ -2875,14 +2875,17 @@ void Tokenizer::setVarId()
|
||||||
{
|
{
|
||||||
++_varId;
|
++_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())
|
for (Token *tok2 = tok; tok2; tok2 = tok2->next())
|
||||||
{
|
{
|
||||||
if (Token::Match(tok2, pattern.c_str(), tok->varId()))
|
if (tok2->varId() == tok->varId())
|
||||||
|
{
|
||||||
|
if (Token::Match(tok2->next(), pattern.c_str()))
|
||||||
tok2->tokAt(2)->varId(_varId);
|
tok2->tokAt(2)->varId(_varId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Member functions and variables in this source
|
// Member functions and variables in this source
|
||||||
std::list<Token *> allMemberFunctions;
|
std::list<Token *> allMemberFunctions;
|
||||||
|
|
Loading…
Reference in New Issue