aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/generator/shiboken2/cppgenerator.cpp')
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
index ea970331e..906e82c93 100644
--- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
@@ -85,10 +85,9 @@ static const char *typeNameOf(const T &t)
inline AbstractMetaType *getTypeWithoutContainer(AbstractMetaType *arg)
{
if (arg && arg->typeEntry()->isContainer()) {
- AbstractMetaTypeList lst = arg->instantiations();
// only support containers with 1 type
- if (lst.size() == 1)
- return lst[0];
+ if (arg->instantiations().size() == 1)
+ return arg->instantiations().constFirst();
}
return arg;
}
@@ -6265,7 +6264,7 @@ void CppGenerator::writeDefaultSequenceMethods(QTextStream &s, const GeneratorCo
<< CPP_SELF_VAR << "->begin();\n"
<< INDENT << "std::advance(_item, _i);\n";
- const AbstractMetaTypeList instantiations = metaClass->templateBaseClassInstantiations();
+ const AbstractMetaTypeList &instantiations = metaClass->templateBaseClassInstantiations();
if (instantiations.isEmpty()) {
qFatal("shiboken: %s: Internal error, no instantiations of \"%s\" were found.",
__FUNCTION__, qPrintable(metaClass->qualifiedCppName()));