Remove unreachable code and repeated computation

This commit is contained in:
Dmitry-Me 2020-02-05 18:20:43 +03:00
parent 59635e2706
commit e9b7e7811b
1 changed files with 3 additions and 3 deletions

View File

@ -716,10 +716,10 @@ bool TemplateSimplifier::getTemplateDeclarations()
continue;
// skip to last nested template parameter
const Token *tok1 = tok;
while (tok1 && tok1->next() && Token::simpleMatch(tok1->next()->findClosingBracket(), "> template <")) {
while (tok1 && tok1->next()) {
const Token *closing = tok1->next()->findClosingBracket();
if (!closing)
syntaxError(tok1->next());
if (!Token::simpleMatch(closing, "> template <"))
break;
tok1 = closing->next();
}
if (!tok1)