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; continue;
// skip to last nested template parameter // skip to last nested template parameter
const Token *tok1 = tok; const Token *tok1 = tok;
while (tok1 && tok1->next() && Token::simpleMatch(tok1->next()->findClosingBracket(), "> template <")) { while (tok1 && tok1->next()) {
const Token *closing = tok1->next()->findClosingBracket(); const Token *closing = tok1->next()->findClosingBracket();
if (!closing) if (!Token::simpleMatch(closing, "> template <"))
syntaxError(tok1->next()); break;
tok1 = closing->next(); tok1 = closing->next();
} }
if (!tok1) if (!tok1)