Tokenizer: Optimised loop
This commit is contained in:
parent
33e69df6ae
commit
9cfc1030cd
|
@ -5114,15 +5114,17 @@ void Tokenizer::simplifyVarDecl(Token * tokBegin, Token * tokEnd, bool only_k_r_
|
|||
} else
|
||||
continue;
|
||||
} else if (tok->str() == "(") {
|
||||
for (Token * tok2 = tok; tok2 != tok->link(); tok2 = tok2->next()) {
|
||||
if (isCPP() && Token::Match(tok2, "[(,] [")) {
|
||||
// lambda function at tok2->next()
|
||||
// find start of lambda body
|
||||
Token * lambdaBody = tok2;
|
||||
while (lambdaBody && lambdaBody != tok2->link() && lambdaBody->str() != "{")
|
||||
lambdaBody = lambdaBody->next();
|
||||
if (lambdaBody && lambdaBody != tok2->link() && lambdaBody->link())
|
||||
simplifyVarDecl(lambdaBody, lambdaBody->link()->next(), only_k_r_fpar);
|
||||
if (isCPP()) {
|
||||
for (Token * tok2 = tok; tok2 != tok->link(); tok2 = tok2->next()) {
|
||||
if (Token::Match(tok2, "[(,] [")) {
|
||||
// lambda function at tok2->next()
|
||||
// find start of lambda body
|
||||
Token * lambdaBody = tok2;
|
||||
while (lambdaBody && lambdaBody != tok2->link() && lambdaBody->str() != "{")
|
||||
lambdaBody = lambdaBody->next();
|
||||
if (lambdaBody && lambdaBody != tok2->link() && lambdaBody->link())
|
||||
simplifyVarDecl(lambdaBody, lambdaBody->link()->next(), only_k_r_fpar);
|
||||
}
|
||||
}
|
||||
}
|
||||
tok = tok->link();
|
||||
|
|
Loading…
Reference in New Issue