Tokenizer::simplifyIfAddBraces: use Token::link() instead of loop.
No functional change.
This commit is contained in:
parent
cbeb45566b
commit
2664bcf650
|
@ -1816,15 +1816,7 @@ bool Tokenizer::simplifyIfAddBraces()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Goto the ending ')'
|
// Goto the ending ')'
|
||||||
int parlevel = 1;
|
tok = tok->next()->link();
|
||||||
tok = tok->next();
|
|
||||||
while (parlevel >= 1 && (tok = tok->next()))
|
|
||||||
{
|
|
||||||
if (tok->str() == "(")
|
|
||||||
++parlevel;
|
|
||||||
else if (tok->str() == ")")
|
|
||||||
--parlevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ')' should be followed by '{'
|
// ')' should be followed by '{'
|
||||||
if (!tok || Token::simpleMatch(tok, ") {"))
|
if (!tok || Token::simpleMatch(tok, ") {"))
|
||||||
|
|
Loading…
Reference in New Issue