From e9b7e7811be942b5ffe20d424baf0e2db30355bd Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Wed, 5 Feb 2020 18:20:43 +0300 Subject: [PATCH] Remove unreachable code and repeated computation --- lib/templatesimplifier.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/templatesimplifier.cpp b/lib/templatesimplifier.cpp index aced06540..90103974d 100644 --- a/lib/templatesimplifier.cpp +++ b/lib/templatesimplifier.cpp @@ -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)