Tokenizer: Optimised loop

This commit is contained in:
Daniel Marjamäki 2013-10-06 07:46:35 +02:00
parent 33e69df6ae
commit 9cfc1030cd
1 changed files with 11 additions and 9 deletions

View File

@ -5114,8 +5114,9 @@ void Tokenizer::simplifyVarDecl(Token * tokBegin, Token * tokEnd, bool only_k_r_
} else
continue;
} else if (tok->str() == "(") {
if (isCPP()) {
for (Token * tok2 = tok; tok2 != tok->link(); tok2 = tok2->next()) {
if (isCPP() && Token::Match(tok2, "[(,] [")) {
if (Token::Match(tok2, "[(,] [")) {
// lambda function at tok2->next()
// find start of lambda body
Token * lambdaBody = tok2;
@ -5125,6 +5126,7 @@ void Tokenizer::simplifyVarDecl(Token * tokBegin, Token * tokEnd, bool only_k_r_
simplifyVarDecl(lambdaBody, lambdaBody->link()->next(), only_k_r_fpar);
}
}
}
tok = tok->link();
}