aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlobjectcreator.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-04-10 15:17:51 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-04-16 17:14:25 +0000
commit33aa21ab0430ae71f5ee44459e250091c09d56b1 (patch)
tree944b25bfb0b9eb76c549bd054584f03be706dddc /src/qml/qml/qqmlobjectcreator.cpp
parent61f218b4e772c1d97e32ef8031de0043473ebbef (diff)
Speed up composite type instantiation with lots of IDs
We don't need to convert from a QHash to a QVector in order to populate the property name cache in QQmlContextData. Change-Id: Ifa8e4f64a1e174907e92684b2d38abaf0a4a705c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index e7a08773f4..4c86e6a307 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -192,17 +192,7 @@ QObject *QQmlObjectCreator::create(int subComponentIndex, QObject *parent, QQmlI
if (topLevelCreator)
sharedState->allJavaScriptObjects = scope.alloc(compiledData->totalObjectCount);
- QVector<QQmlContextData::ObjectIdMapping> mapping(objectIndexToId.count());
- for (QHash<int, int>::ConstIterator it = objectIndexToId.constBegin(), end = objectIndexToId.constEnd();
- it != end; ++it) {
- const QV4::CompiledData::Object *obj = qmlUnit->objectAt(it.key());
-
- QQmlContextData::ObjectIdMapping m;
- m.id = it.value();
- m.name = stringAt(obj->idIndex);
- mapping[m.id] = m;
- }
- context->setIdPropertyData(mapping);
+ context->setIdPropertyData(objectIndexToId);
if (subComponentIndex == -1 && compiledData->scripts.count()) {
QV4::ScopedObject scripts(scope, v4->newArrayObject(compiledData->scripts.count()));