aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-01-15 15:41:29 +0300
committerAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-01-18 07:57:56 +0000
commitf644f86c84287065535fbd8c3478a5b2550437ac (patch)
tree54640dd88fa7e4cc3ce03b15d6ed3a7c2b005070 /src/quick/util
parent1cbf064cdf6d24ddbb6bf30b08a88ec1bf03d3df (diff)
Quick: fix expensive iteration over QHash::keys() and QMap::keys()
Change-Id: I21c48214bfddde01f71710705fe01418818a6581 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/quick/util')
-rw-r--r--src/quick/util/qquickanimatorcontroller.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/quick/util/qquickanimatorcontroller.cpp b/src/quick/util/qquickanimatorcontroller.cpp
index 74930fb373..355dba0215 100644
--- a/src/quick/util/qquickanimatorcontroller.cpp
+++ b/src/quick/util/qquickanimatorcontroller.cpp
@@ -72,11 +72,13 @@ QQuickAnimatorController::~QQuickAnimatorController()
foreach (QQuickAnimatorProxyJob *proxy, m_animatorRoots)
proxy->controllerWasDeleted();
- qDeleteAll(m_animatorRoots.keys());
+ for (auto it = m_animatorRoots.keyBegin(), end = m_animatorRoots.keyEnd(); it != end; ++it)
+ delete *it;
// Delete those who have been started, stopped and are now still
// pending for restart.
- foreach (QAbstractAnimationJob *job, m_starting.keys()) {
+ for (auto it = m_starting.keyBegin(), end = m_starting.keyEnd(); it != end; ++it) {
+ QAbstractAnimationJob *job = *it;
if (!m_animatorRoots.contains(job))
delete job;
}