diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-11-19 15:30:45 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-11-26 17:57:36 +0100 |
commit | b897d69cf7071eb53432ded62fdc80a2a6258e98 (patch) | |
tree | 4b3816e9c2761ce90689e7259de9ee2567cd32a8 /src/qml/qml/qqmlpropertycache_p.h | |
parent | 718472d8e1e30fe2b0bc0e3b514ea0ed20259737 (diff) |
Always fully resolve property data on creation
Resolving things lazily is not really optimizing anything.
Task-number: QTBUG-82931
Change-Id: Iff9e1c7c16ae0dec7e0cec018ed73c6c98542925
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlpropertycache_p.h')
-rw-r--r-- | src/qml/qml/qqmlpropertycache_p.h | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h index 8a958f7659..503ee7aa5d 100644 --- a/src/qml/qml/qqmlpropertycache_p.h +++ b/src/qml/qml/qqmlpropertycache_p.h @@ -256,9 +256,6 @@ private: QQmlPropertyData *findProperty(StringCache::ConstIterator it, const QQmlVMEMetaObject *, const QQmlRefPointer<QQmlContextData> &) const; - QQmlPropertyData *ensureResolved(QQmlPropertyData*) const; - - Q_NEVER_INLINE void resolve(QQmlPropertyData *) const; void updateRecur(const QMetaObject *); template<typename K> @@ -299,14 +296,6 @@ private: QByteArray _checksum; }; -inline QQmlPropertyData *QQmlPropertyCache::ensureResolved(QQmlPropertyData *p) const -{ - if (p && Q_UNLIKELY(p->notFullyResolved())) - resolve(p); - - return p; -} - // Returns this property cache's metaObject. May be null if it hasn't been created yet. inline const QMetaObject *QQmlPropertyCache::metaObject() const { @@ -331,8 +320,7 @@ inline QQmlPropertyData *QQmlPropertyCache::property(int index) const if (index < propertyIndexCacheStart) return _parent->property(index); - QQmlPropertyData *rv = const_cast<QQmlPropertyData *>(&propertyIndexCache.at(index - propertyIndexCacheStart)); - return ensureResolved(rv); + return const_cast<QQmlPropertyData *>(&propertyIndexCache.at(index - propertyIndexCacheStart)); } inline QQmlPropertyData *QQmlPropertyCache::method(int index) const @@ -343,8 +331,7 @@ inline QQmlPropertyData *QQmlPropertyCache::method(int index) const if (index < methodIndexCacheStart) return _parent->method(index); - QQmlPropertyData *rv = const_cast<QQmlPropertyData *>(&methodIndexCache.at(index - methodIndexCacheStart)); - return ensureResolved(rv); + return const_cast<QQmlPropertyData *>(&methodIndexCache.at(index - methodIndexCacheStart)); } /*! \internal @@ -361,7 +348,7 @@ inline QQmlPropertyData *QQmlPropertyCache::signal(int index) const QQmlPropertyData *rv = const_cast<QQmlPropertyData *>(&methodIndexCache.at(index - signalHandlerIndexCacheStart)); Q_ASSERT(rv->isSignal() || rv->coreIndex() == -1); - return ensureResolved(rv); + return rv; } inline QQmlEnumData *QQmlPropertyCache::qmlEnum(int index) const |