Refactoring: Use the Token::link

This commit is contained in:
Daniel Marjamäki 2009-08-30 10:27:26 +02:00
parent e1cdbf3c5a
commit f9b84805d9
1 changed files with 8 additions and 22 deletions

View File

@ -1593,29 +1593,15 @@ void Tokenizer::simplifyTokenList()
{
while (Token::simpleMatch(tok, "return ("))
{
unsigned int parlevel = 0;
for (Token *tok2 = tok; tok2; tok2 = tok2->next())
Token *tok2 = tok->next()->link();
if (Token::simpleMatch(tok2, ") ;"))
{
if (tok2->str() == "(")
++parlevel;
else if (tok2->str() == ")")
{
if (parlevel <= 1)
{
if (Token::simpleMatch(tok2, ") ;"))
{
tok->deleteNext();
tok2->deleteThis();
}
else
{
tok = tok->next();
}
break;
}
--parlevel;
}
tok->deleteNext();
tok2->deleteThis();
}
else
{
break;
}
}
}