diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2016-05-25 10:25:25 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-05-26 11:33:00 +0000 |
commit | 8457ca1b3dfb048acdb4426960ad7ee7c8227ed4 (patch) | |
tree | d33256028f22b5a28a9ea6fda3b98bedc5aeebab /src/qml/qml/qqmlobjectcreator_p.h | |
parent | 899c1ef0f7574019f1b41a922b2ba10614df130f (diff) |
Simplify object to id-in-context mapping
By storing the calculated integer id for an id-named object in
CompiledData::Object we can simplify the code and replace a hash table with a
plain vector.
Change-Id: I4a84cdd00e98766d603d152e5a6574b232771a02
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator_p.h')
-rw-r--r-- | src/qml/qml/qqmlobjectcreator_p.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlobjectcreator_p.h b/src/qml/qml/qqmlobjectcreator_p.h index 8045281cbb..e2e17bcf6c 100644 --- a/src/qml/qml/qqmlobjectcreator_p.h +++ b/src/qml/qml/qqmlobjectcreator_p.h @@ -122,7 +122,7 @@ private: QString stringAt(int idx) const { return qmlUnit->stringAt(idx); } void recordError(const QV4::CompiledData::Location &location, const QString &description); - void registerObjectWithContextById(int objectIndex, QObject *instance) const; + void registerObjectWithContextById(const QV4::CompiledData::Object *object, QObject *instance) const; QV4::Heap::QmlContext *currentQmlContext(); @@ -143,7 +143,7 @@ private: QQmlContextData *context; const QHash<int, QQmlCompiledData::TypeReference*> &resolvedTypes; const QQmlPropertyCacheVector &propertyCaches; - QHash<int, int> objectIndexToId; + QVector<quint32> namedObjects; QExplicitlySharedDataPointer<QQmlObjectCreatorSharedState> sharedState; bool topLevelCreator; void *activeVMEDataForRootContext; |