From 5364c6055f575950fbcd49ffcc59e60a4bb4b0b0 Mon Sep 17 00:00:00 2001 From: IOBYTE Date: Tue, 7 May 2019 04:26:41 -0400 Subject: [PATCH] template simplifier: fix cppcheck warning (#1824) --- lib/templatesimplifier.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/templatesimplifier.cpp b/lib/templatesimplifier.cpp index d2982e565..66f4eac02 100644 --- a/lib/templatesimplifier.cpp +++ b/lib/templatesimplifier.cpp @@ -2541,8 +2541,7 @@ bool TemplateSimplifier::simplifyTemplateInstantiations( const std::string newName(templateDeclaration.name + " < " + typeForNewName + " >"); const std::string newFullName(templateDeclaration.scope + (templateDeclaration.scope.empty() ? "" : " :: ") + newName); - if (expandedtemplates.find(newFullName) == expandedtemplates.end()) { - expandedtemplates.insert(newFullName); + if (expandedtemplates.insert(newFullName).second) { expandTemplate(templateDeclaration, instantiation, typeParametersInDeclaration, newName, !specialized && !isVar); instantiated = true; } @@ -2607,8 +2606,7 @@ bool TemplateSimplifier::simplifyTemplateInstantiations( const std::string newName(templateDeclaration.name + " < " + typeForNewName + " >"); const std::string newFullName(templateDeclaration.scope + (templateDeclaration.scope.empty() ? "" : " :: ") + newName); - if (expandedtemplates.find(newFullName) == expandedtemplates.end()) { - expandedtemplates.insert(newFullName); + if (expandedtemplates.insert(newFullName).second) { expandTemplate(templateDeclaration, templateDeclaration, typeParametersInDeclaration, newName, !specialized && !isVar); instantiated = true; }