Tokenizer::simplifyIfAddBraces: use Token::link() instead of loop.

No functional change.
This commit is contained in:
Slava Semushin 2009-08-22 14:54:28 +07:00
parent cbeb45566b
commit 2664bcf650
1 changed files with 1 additions and 9 deletions

View File

@ -1816,15 +1816,7 @@ bool Tokenizer::simplifyIfAddBraces()
}
// Goto the ending ')'
int parlevel = 1;
tok = tok->next();
while (parlevel >= 1 && (tok = tok->next()))
{
if (tok->str() == "(")
++parlevel;
else if (tok->str() == ")")
--parlevel;
}
tok = tok->next()->link();
// ')' should be followed by '{'
if (!tok || Token::simpleMatch(tok, ") {"))