From 667038a4027f06a25be342f825fd45c7b18b1b4f Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Wed, 24 Aug 2016 15:10:39 +0300 Subject: [PATCH] Merge overlapping patterns --- lib/templatesimplifier.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/templatesimplifier.cpp b/lib/templatesimplifier.cpp index 5b7602b6b..452de4142 100644 --- a/lib/templatesimplifier.cpp +++ b/lib/templatesimplifier.cpp @@ -100,11 +100,11 @@ void TemplateSimplifier::cleanupAfterSimplify(Token *tokens) (!tok->previous() || tok->previous()->str() == ";")) { const Token *tok2 = tok->tokAt(2); std::string type; - while (Token::Match(tok2, "%type% ,") || Token::Match(tok2, "%num% ,")) { + while (Token::Match(tok2, "%type%|%num% ,")) { type += tok2->str() + ","; tok2 = tok2->tokAt(2); } - if (Token::Match(tok2, "%type% > (") || Token::Match(tok2, "%num% > (")) { + if (Token::Match(tok2, "%type%|%num% > (")) { type += tok2->str(); tok->str(tok->str() + "<" + type + ">"); Token::eraseTokens(tok, tok2->tokAt(2));