template simplifier: fix cppcheck warning (#1824)
This commit is contained in:
parent
baeae95bac
commit
5364c6055f
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue