template simplifier: fix cppcheck warning (#1824)

This commit is contained in:
IOBYTE 2019-05-07 04:26:41 -04:00 committed by Daniel Marjamäki
parent baeae95bac
commit 5364c6055f
1 changed files with 2 additions and 4 deletions

View File

@ -2541,8 +2541,7 @@ bool TemplateSimplifier::simplifyTemplateInstantiations(
const std::string newName(templateDeclaration.name + " < " + typeForNewName + " >"); const std::string newName(templateDeclaration.name + " < " + typeForNewName + " >");
const std::string newFullName(templateDeclaration.scope + (templateDeclaration.scope.empty() ? "" : " :: ") + newName); const std::string newFullName(templateDeclaration.scope + (templateDeclaration.scope.empty() ? "" : " :: ") + newName);
if (expandedtemplates.find(newFullName) == expandedtemplates.end()) { if (expandedtemplates.insert(newFullName).second) {
expandedtemplates.insert(newFullName);
expandTemplate(templateDeclaration, instantiation, typeParametersInDeclaration, newName, !specialized && !isVar); expandTemplate(templateDeclaration, instantiation, typeParametersInDeclaration, newName, !specialized && !isVar);
instantiated = true; instantiated = true;
} }
@ -2607,8 +2606,7 @@ bool TemplateSimplifier::simplifyTemplateInstantiations(
const std::string newName(templateDeclaration.name + " < " + typeForNewName + " >"); const std::string newName(templateDeclaration.name + " < " + typeForNewName + " >");
const std::string newFullName(templateDeclaration.scope + (templateDeclaration.scope.empty() ? "" : " :: ") + newName); const std::string newFullName(templateDeclaration.scope + (templateDeclaration.scope.empty() ? "" : " :: ") + newName);
if (expandedtemplates.find(newFullName) == expandedtemplates.end()) { if (expandedtemplates.insert(newFullName).second) {
expandedtemplates.insert(newFullName);
expandTemplate(templateDeclaration, templateDeclaration, typeParametersInDeclaration, newName, !specialized && !isVar); expandTemplate(templateDeclaration, templateDeclaration, typeParametersInDeclaration, newName, !specialized && !isVar);
instantiated = true; instantiated = true;
} }