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; }