diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2024-11-25 10:34:01 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2024-11-29 16:41:16 +0100 |
| commit | 804d6ceec11e687e4fa821a2b6ceb4223597d0ab (patch) | |
| tree | 3ceed985d038e77bec7639fc0dac15e573c54bd3 /src/qmlcompiler/qqmljsutils.cpp | |
| parent | 992eb4f2f5326edbd452d631fe34308480d32282 (diff) | |
QmlCompiler: Remove trivial type comparison methods
We can compare types without QQmlJSTypeResovler now.
Task-number: QTBUG-124670
Change-Id: Id06c8cd5cc8f03683134ad13e02d54ae4da9fae3
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsutils.cpp')
| -rw-r--r-- | src/qmlcompiler/qqmljsutils.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/qmlcompiler/qqmljsutils.cpp b/src/qmlcompiler/qqmljsutils.cpp index f40d4932ca..2fc0564edc 100644 --- a/src/qmlcompiler/qqmljsutils.cpp +++ b/src/qmlcompiler/qqmljsutils.cpp @@ -214,8 +214,8 @@ bool canStrictlyCompareWithVar( Q_ASSERT(typeResolver); const QQmlJSScope::ConstPtr varType = typeResolver->varType(); - const bool leftIsVar = typeResolver->equals(lhsType, varType); - const bool righttIsVar = typeResolver->equals(rhsType, varType); + const bool leftIsVar = (lhsType == varType); + const bool righttIsVar = (rhsType == varType); return leftIsVar != righttIsVar; } @@ -230,11 +230,9 @@ bool canCompareWithQObject( { Q_ASSERT(typeResolver); return (lhsType->isReferenceType() - && (rhsType->isReferenceType() - || typeResolver->equals(rhsType, typeResolver->nullType()))) + && (rhsType->isReferenceType() || rhsType == typeResolver->nullType())) || (rhsType->isReferenceType() - && (lhsType->isReferenceType() - || typeResolver->equals(lhsType, typeResolver->nullType()))); + && (lhsType->isReferenceType() || lhsType == typeResolver->nullType())); } /*! \internal @@ -247,8 +245,7 @@ bool canCompareWithQUrl( const QQmlJSScope::ConstPtr &rhsType) { Q_ASSERT(typeResolver); - return typeResolver->equals(lhsType, typeResolver->urlType()) - && typeResolver->equals(rhsType, typeResolver->urlType()); + return lhsType == typeResolver->urlType() && rhsType == typeResolver->urlType(); } static QVarLengthArray<QString, 2> resourceFoldersFromBuildFolder(const QString &buildFolder) |
