aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2017-09-08 10:34:45 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2017-09-08 12:46:44 +0000
commit5f17840a14e22da0cfa973b36b9f6ce3bc8d4067 (patch)
tree66efa1e23974b91664c30de7aae085dddfdf531e /src
parentebda8170a6b00b830fba59a230506ab3ca52e6c5 (diff)
Remove temporary allocations during type cleanup
As a follow-up commit to 48c09a85, avoid the use of key() to create a temporary string when cleaning the QML type registry. There is strictly speaking no need to perform another hash lookup anyway. Change-Id: Ibd5f0210d5584d1f847d8ec61f25cb0972076365 Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qml/qml/qqmlmetatype.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp
index ca0522aa99..5bbc250d5e 100644
--- a/src/qml/qml/qqmlmetatype.cpp
+++ b/src/qml/qml/qqmlmetatype.cpp
@@ -1215,7 +1215,7 @@ void QQmlTypeModulePrivate::add(QQmlTypePrivate *type)
void QQmlTypeModulePrivate::remove(const QQmlTypePrivate *type)
{
for (TypeHash::ConstIterator elementIt = typeHash.begin(); elementIt != typeHash.end();) {
- QList<QQmlTypePrivate *> &list = typeHash[elementIt.key()];
+ QList<QQmlTypePrivate *> &list = const_cast<QList<QQmlTypePrivate *> &>(elementIt.value());
removeQQmlTypePrivate(list, type);