aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/generator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/generator/generator.cpp')
-rw-r--r--sources/shiboken2/generator/generator.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/sources/shiboken2/generator/generator.cpp b/sources/shiboken2/generator/generator.cpp
index dd56ab7cd..f90cd312f 100644
--- a/sources/shiboken2/generator/generator.cpp
+++ b/sources/shiboken2/generator/generator.cpp
@@ -276,24 +276,24 @@ void Generator::addInstantiatedContainersAndSmartPointers(const AbstractMetaType
return;
}
- QString typeName = getSimplifiedContainerTypeName(type);
if (isContainer) {
+ QString typeName = getSimplifiedContainerTypeName(type);
if (!m_d->instantiatedContainersNames.contains(typeName)) {
m_d->instantiatedContainersNames.append(typeName);
m_d->instantiatedContainers.append(type);
}
- } else {
- // Is smart pointer. Check if the (const?) pointee is already known
- auto pt = pointeeTypeEntry(type);
- const bool present =
- std::any_of(m_d->instantiatedSmartPointers.cbegin(), m_d->instantiatedSmartPointers.cend(),
- [pt] (const AbstractMetaType *t) {
- return pointeeTypeEntry(t) == pt;
- });
- if (!present)
- m_d->instantiatedSmartPointers.append(canonicalSmartPtrInstantiation(type));
+ return;
}
-
+ // Is smart pointer. Check if the (const?) pointee is already known for the given
+ // smart pointer type entry.
+ auto pt = pointeeTypeEntry(type);
+ const bool present =
+ std::any_of(m_d->instantiatedSmartPointers.cbegin(), m_d->instantiatedSmartPointers.cend(),
+ [typeEntry, pt] (const AbstractMetaType *t) {
+ return t->typeEntry() == typeEntry && pointeeTypeEntry(t) == pt;
+ });
+ if (!present)
+ m_d->instantiatedSmartPointers.append(canonicalSmartPtrInstantiation(type));
}
void Generator::collectInstantiatedContainersAndSmartPointers(const AbstractMetaFunction *func)