aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlengine.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-02-23 13:44:12 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-02-26 15:13:34 +0000
commit5163c11952a39458dd6d7ba10391c2b39ccdf86a (patch)
tree98c03a10d5c9e51a5aa6f950d642ee6a7b93031f /src/qml/qml/qqmlengine.cpp
parenta7c0e62b9122a8d210149570be8834401b9b36d3 (diff)
QtQml: Micro-optimize iterator loops.
Avoid repeated instantiation of end() in loops, use variable instead. Change-Id: I3bb1c6918cfd16a5dcefbcc03c442e99fe9bf76b Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlengine.cpp')
-rw-r--r--src/qml/qml/qqmlengine.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 916f848bbe..70090bd3f9 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -595,6 +595,9 @@ QQmlEnginePrivate::QQmlEnginePrivate(QQmlEngine *e)
QQmlEnginePrivate::~QQmlEnginePrivate()
{
+ typedef QHash<QPair<QQmlType *, int>, QQmlPropertyCache *>::Iterator TypePropertyCacheIt;
+ typedef QHash<int, QQmlCompiledData *>::Iterator CompositeTypesIt;
+
if (inProgressCreations)
qWarning() << QQmlEngine::tr("There are still \"%1\" items in the process of being created at engine destruction.").arg(inProgressCreations);
@@ -612,9 +615,9 @@ QQmlEnginePrivate::~QQmlEnginePrivate()
if (incubationController) incubationController->d = 0;
incubationController = 0;
- for(QHash<QPair<QQmlType *, int>, QQmlPropertyCache *>::Iterator iter = typePropertyCache.begin(); iter != typePropertyCache.end(); ++iter)
+ for (TypePropertyCacheIt iter = typePropertyCache.begin(), end = typePropertyCache.end(); iter != end; ++iter)
(*iter)->release();
- for (QHash<int, QQmlCompiledData *>::Iterator iter = m_compositeTypes.begin(); iter != m_compositeTypes.end(); ++iter)
+ for (CompositeTypesIt iter = m_compositeTypes.begin(), end = m_compositeTypes.end(); iter != end; ++iter)
iter.value()->isRegisteredWithEngine = false;
delete profiler;
}