diff options
author | Frank Meerkoetter <frank.meerkoetter@basyskom.com> | 2016-05-13 17:57:24 +0200 |
---|---|---|
committer | Frank Meerkoetter <frank.meerkoetter@basyskom.com> | 2016-05-25 19:27:33 +0000 |
commit | 573356464ba73afcbed173d939f9b54d8e201685 (patch) | |
tree | a02271efc22b077831c1cfe6776f3a98ee6b647a /src/quick/util/qquicksmoothedanimation.cpp | |
parent | b88e0091de65950a3e7c5ace6d8e6ca2b486a07d (diff) |
Fixed another batch of QHash/QMap::values() (mis)use
Avoid memory allocations.
Change-Id: I0b4cbef6a8c22184781a44d92172d93ac38e778c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Anton Kudryavtsev <a.kudryavtsev@netris.ru>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/quick/util/qquicksmoothedanimation.cpp')
-rw-r--r-- | src/quick/util/qquicksmoothedanimation.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/quick/util/qquicksmoothedanimation.cpp b/src/quick/util/qquicksmoothedanimation.cpp index d4956983fb..569cb37c95 100644 --- a/src/quick/util/qquicksmoothedanimation.cpp +++ b/src/quick/util/qquicksmoothedanimation.cpp @@ -392,7 +392,7 @@ QQuickSmoothedAnimationPrivate::~QQuickSmoothedAnimationPrivate() void QQuickSmoothedAnimationPrivate::updateRunningAnimations() { - foreach(QSmoothedAnimation* ease, activeAnimations.values()){ + for (QSmoothedAnimation *ease : qAsConst(activeAnimations)) { ease->maximumEasingTime = anim->maximumEasingTime; ease->reversingMode = anim->reversingMode; ease->velocity = anim->velocity; @@ -444,7 +444,8 @@ QAbstractAnimationJob* QQuickSmoothedAnimation::transition(QQuickStateActions &a anims.insert(ease); } - foreach (QSmoothedAnimation *ease, d->activeAnimations.values()){ + const auto copy = d->activeAnimations; + for (QSmoothedAnimation *ease : copy) { if (!anims.contains(ease)) { ease->clearTemplate(); d->activeAnimations.remove(ease->target); |