Optimisation: Made Tokenizer::simplifyInitVar faster

This commit is contained in:
Daniel Marjamäki 2010-09-26 15:54:41 +02:00
parent fd7ba05fa6
commit cdecbe29d0
1 changed files with 6 additions and 6 deletions

View File

@ -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);
} }
} }