aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcontext_p.h
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/qqmlcontext_p.h
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/qqmlcontext_p.h')
-rw-r--r--src/qml/qml/qqmlcontext_p.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/qml/qml/qqmlcontext_p.h b/src/qml/qml/qqmlcontext_p.h
index 40bd310cb7..f5fd7d0a5c 100644
--- a/src/qml/qml/qqmlcontext_p.h
+++ b/src/qml/qml/qqmlcontext_p.h
@@ -144,15 +144,7 @@ public:
// Compilation unit for contexts that belong to a compiled type.
QQmlRefPointer<QV4::CompiledData::CompilationUnit> typeCompilationUnit;
- struct ObjectIdMapping {
- ObjectIdMapping() : id(-1) {}
- ObjectIdMapping(const QString &name, int id)
- : name(name), id(id) {}
- QString name;
- int id;
- };
-
- mutable QVector<ObjectIdMapping> idObjectNames;
+ mutable QHash<int, int> objectIndexToId;
mutable QV4::IdentifierHash<int> propertyNameCache;
QV4::IdentifierHash<int> &propertyNames() const;
@@ -202,7 +194,7 @@ public:
ContextGuard *idValues;
int idValueCount;
void setIdProperty(int, QObject *);
- void setIdPropertyData(const QVector<ObjectIdMapping> &);
+ void setIdPropertyData(const QHash<int, int> &);
// Linked contexts. this owns linkedContext.
QQmlContextData *linkedContext;