Tokenizer::simplifyGoto: Only simplify the last label in the function. If there are many labels in the same function and all labels are simplified, this function becomes very slow.

This commit is contained in:
Daniel Marjamäki 2011-07-01 18:07:41 +02:00
parent 301e59cea0
commit db4a28d60b
1 changed files with 12 additions and 1 deletions

View File

@ -7914,8 +7914,19 @@ void Tokenizer::simplifyGoto()
} }
} }
// goto the end of the function
while (tok)
{
if (tok->str() == "{")
tok = tok->link();
else if (tok->str() == "}")
break;
tok = tok->next();
}
if (!tok)
break;
gotos.clear(); gotos.clear();
tok = beginfunction; beginfunction = 0;
indentlevel = 0; indentlevel = 0;
continue; continue;
} }