diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-02-03 11:44:12 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-02-03 12:58:16 +0100 |
commit | 0ec209743d53fba031c13ec5c717ca106a6df6ed (patch) | |
tree | 817cdf90bc0274dafdb9c1bf0d42a052c4aaa09c /src/qmltyperegistrar | |
parent | b718beea0ea4fee513efc06da0e6b83186ea7c02 (diff) |
Fix compiler warning, QJsonArray does not return references
Clang warning on macOS: warning: loop variable 'classInfo' is always
a copy because the range of type 'const QJsonArray' does not return
a reference [-Wrange-loop-analysis]
Change-Id: I7657d85fe44b5e106ead6d26d4481256e7ccfc71
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qmltyperegistrar')
-rw-r--r-- | src/qmltyperegistrar/qmltypesclassdescription.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qmltyperegistrar/qmltypesclassdescription.cpp b/src/qmltyperegistrar/qmltypesclassdescription.cpp index 90f7565e5e..5d022d6488 100644 --- a/src/qmltyperegistrar/qmltypesclassdescription.cpp +++ b/src/qmltyperegistrar/qmltypesclassdescription.cpp @@ -35,7 +35,7 @@ static void collectExtraVersions(const QJsonObject *component, const QString &ke QList<QTypeRevision> &extraVersions) { const QJsonArray &items = component->value(key).toArray(); - for (const QJsonValue &item : items) { + for (const QJsonValue item : items) { const QJsonObject obj = item.toObject(); const auto revision = obj.find(QLatin1String("revision")); if (revision != obj.end()) { @@ -63,7 +63,7 @@ void QmlTypesClassDescription::collectSuperClasses( const QVector<QJsonObject> &foreign, CollectMode mode, QTypeRevision defaultRevision) { const auto supers = classDef->value(QLatin1String("superClasses")).toArray(); - for (const QJsonValue &superValue : supers) { + for (const QJsonValue superValue : supers) { const QJsonObject superObject = superValue.toObject(); if (superObject[QLatin1String("access")].toString() == QLatin1String("public")) { const QString superName = superObject[QLatin1String("name")].toString(); @@ -86,7 +86,7 @@ void QmlTypesClassDescription::collectInterfaces(const QJsonObject *classDef) { if (classDef->contains(QLatin1String("interfaces"))) { const QJsonArray array = classDef->value(QLatin1String("interfaces")).toArray(); - for (const QJsonValue &value : array) { + for (const QJsonValue value : array) { auto object = value.toArray()[0].toObject(); implementsInterfaces << object[QLatin1String("className")].toString(); } @@ -110,7 +110,7 @@ void QmlTypesClassDescription::collectLocalAnonymous( accessSemantics = QStringLiteral("none"); const auto classInfos = classDef->value(QLatin1String("classInfos")).toArray(); - for (const QJsonValue &classInfo : classInfos) { + for (const QJsonValue classInfo : classInfos) { const QJsonObject obj = classInfo.toObject(); if (obj[QStringLiteral("name")].toString() == QStringLiteral("DefaultProperty")) defaultProp = obj[QStringLiteral("value")].toString(); @@ -130,7 +130,7 @@ void QmlTypesClassDescription::collect( const auto classInfos = classDef->value(QLatin1String("classInfos")).toArray(); const QString classDefName = classDef->value(QLatin1String("className")).toString(); QString foreignTypeName; - for (const QJsonValue &classInfo : classInfos) { + for (const QJsonValue classInfo : classInfos) { const QJsonObject obj = classInfo.toObject(); const QString name = obj[QLatin1String("name")].toString(); const QString value = obj[QLatin1String("value")].toString(); @@ -189,7 +189,7 @@ void QmlTypesClassDescription::collect( // Foreign type can have a default property or an attached types const auto classInfos = classDef->value(QLatin1String("classInfos")).toArray(); - for (const QJsonValue &classInfo : classInfos) { + for (const QJsonValue classInfo : classInfos) { const QJsonObject obj = classInfo.toObject(); const QString foreignName = obj[QLatin1String("name")].toString(); const QString foreignValue = obj[QLatin1String("value")].toString(); |