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