diff options
| author | Olivier De Cannière <olivier.decanniere@qt.io> | 2025-04-24 17:13:26 +0200 |
|---|---|---|
| committer | Olivier De Cannière <olivier.decanniere@qt.io> | 2025-04-25 14:32:26 +0200 |
| commit | 2f2b2669a53d9b6faed680759f6b68ef8c6e66ce (patch) | |
| tree | 2c0228ff1347abf2e4aa96be3fe795a9041429d9 /src/qmlcompiler/qqmljsimportvisitor.cpp | |
| parent | 41d1137fea3857f87b49ca576417cce5ef1d7300 (diff) | |
QQmlJSImportVisitor: const-ref-ify
Change-Id: Ia71e88dbd983303c15e532b812550214426d4d6d
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsimportvisitor.cpp')
| -rw-r--r-- | src/qmlcompiler/qqmljsimportvisitor.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/qmlcompiler/qqmljsimportvisitor.cpp b/src/qmlcompiler/qqmljsimportvisitor.cpp index 4525b66930..70555ef4a4 100644 --- a/src/qmlcompiler/qqmljsimportvisitor.cpp +++ b/src/qmlcompiler/qqmljsimportvisitor.cpp @@ -1009,11 +1009,10 @@ void QQmlJSImportVisitor::checkRequiredProperties() return false; }; - const auto warn = [this](QQmlJSScope::ConstPtr prevRequiredScope, - const QString &propName, - QQmlJSScope::ConstPtr defScope, - QQmlJSScope::ConstPtr requiredScope, - QQmlJSScope::ConstPtr descendant) { + const auto warn = [this](const QQmlJSScope::ConstPtr &prevRequiredScope, + const QString &propName, const QQmlJSScope::ConstPtr &defScope, + const QQmlJSScope::ConstPtr &requiredScope, + const QQmlJSScope::ConstPtr &descendant) { const auto &propertyScope = QQmlJSScope::ownerOfProperty(requiredScope, propName).scope; const QString propertyScopeName = !propertyScope.isNull() ? getScopeName(propertyScope, QQmlSA::ScopeType::QMLScope) @@ -1061,7 +1060,7 @@ void QQmlJSImportVisitor::checkRequiredProperties() for (QQmlJSScope::ConstPtr scope = defScope; scope; scope = scope->baseType()) { const auto descendants = QList<QQmlJSScope::ConstPtr>() << scope << qmlScopeDescendants(scope); - for (QQmlJSScope::ConstPtr descendant : std::as_const(descendants)) { + for (const QQmlJSScope::ConstPtr &descendant : std::as_const(descendants)) { // Ignore inline components of children. Base types need to be always checked for // required properties, even if they are defined in an inline component. if (descendant != scope && descendant->isInlineComponent()) @@ -1075,7 +1074,7 @@ void QQmlJSImportVisitor::checkRequiredProperties() continue; QQmlJSScope::ConstPtr prevRequiredScope; - for (QQmlJSScope::ConstPtr requiredScope : std::as_const(scopesToSearch)) { + for (const QQmlJSScope::ConstPtr &requiredScope : std::as_const(scopesToSearch)) { if (isInComponent(requiredScope)) continue; |
