Optimisation: Made Tokenizer::simplifyInitVar faster
This commit is contained in:
parent
fd7ba05fa6
commit
cdecbe29d0
|
@ -5603,12 +5603,12 @@ void Tokenizer::simplifyInitVar()
|
||||||
{
|
{
|
||||||
for (Token *tok = _tokens; tok; tok = tok->next())
|
for (Token *tok = _tokens; tok; tok = tok->next())
|
||||||
{
|
{
|
||||||
if (Token::Match(tok, "{|}|;| class|struct|union| %type% *| %var% ( &| %any% ) ;") ||
|
if (!tok->isName() || (tok->previous() && !Token::Match(tok->previous(), "[;{}]")))
|
||||||
Token::Match(tok, "{|}|;| %type% *| %var% ( %type% ("))
|
continue;
|
||||||
|
|
||||||
|
if (Token::Match(tok, "class|struct|union| %type% *| %var% ( &| %any% ) ;") ||
|
||||||
|
Token::Match(tok, "%type% *| %var% ( %type% ("))
|
||||||
{
|
{
|
||||||
if (Token::Match(tok, "[;{}]"))
|
|
||||||
tok = initVar(tok->next());
|
|
||||||
else
|
|
||||||
tok = initVar(tok);
|
tok = initVar(tok);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue