aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/typesystem.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-17 08:59:33 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-17 10:07:57 +0000
commit108a64dd89132c10cb1fd06b6ac43677f5528783 (patch)
tree3b6be8a1a61dbf3eeb16c9703bbd7a7580d0349e /sources/shiboken2/ApiExtractor/typesystem.cpp
parent181fa70b7ba06c92c3c0fdc4c70081b14e4b1bdf (diff)
shiboken: replace first()/last() by constFirst/constLast()
Fix clazy warnings about possibly detaching containers. Change-Id: I3c3a229de5e0c71f17c1f26273e1b0be3b0d7e81 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/typesystem.cpp')
-rw-r--r--sources/shiboken2/ApiExtractor/typesystem.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/sources/shiboken2/ApiExtractor/typesystem.cpp b/sources/shiboken2/ApiExtractor/typesystem.cpp
index 8564da3c4..4a8d3063d 100644
--- a/sources/shiboken2/ApiExtractor/typesystem.cpp
+++ b/sources/shiboken2/ApiExtractor/typesystem.cpp
@@ -615,11 +615,10 @@ void Handler::addFlags(const QString &name, QString flagName,
if (QStringList(lst.mid(0, lst.size() - 1)).join(colonColon()) != m_currentEnum->targetLangQualifier()) {
qCWarning(lcShiboken).noquote().nospace()
<< QStringLiteral("enum %1 and flags %2 differ in qualifiers")
- // avoid constFirst to stay Qt 5.5 compatible
- .arg(m_currentEnum->targetLangQualifier(), lst.first());
+ .arg(m_currentEnum->targetLangQualifier(), lst.constFirst());
}
- ftype->setFlagsName(lst.last());
+ ftype->setFlagsName(lst.constLast());
m_currentEnum->setFlags(ftype);
m_database->addFlagsType(ftype);
@@ -933,7 +932,7 @@ bool Handler::startElement(const QStringRef &n, const QXmlStreamAttributes &atts
else
m_currentEnum =
new EnumTypeEntry(QStringList(names.mid(0, names.size() - 1)).join(colonColon()),
- names.last(), since);
+ names.constLast(), since);
m_currentEnum->setAnonymous(!attributes[QLatin1String("identified-by-value")].isEmpty());
element->entry = m_currentEnum;
m_currentEnum->setCodeGeneration(m_generate);
@@ -1978,7 +1977,7 @@ bool Handler::startElement(const QStringRef &n, const QXmlStreamAttributes &atts
}
if (topElement.type == StackElement::ModifyFunction || topElement.type == StackElement::AddFunction) {
- FunctionModification mod = m_contextStack.top()->functionMods.last();
+ FunctionModification mod = m_contextStack.top()->functionMods.constLast();
if (snip.language == TypeSystem::ShellDeclaration) {
m_error = QLatin1String("no function implementation in shell declaration in which to inject code");
return false;