diff options
author | Vladimir Belyavsky <belyavskyv@gmail.com> | 2024-04-20 20:34:04 +0300 |
---|---|---|
committer | Vladimir Belyavsky <belyavskyv@gmail.com> | 2024-04-22 11:06:35 +0300 |
commit | 616f7990a101fc7540efd8cf2b0b8db170501fd5 (patch) | |
tree | c75b1f74c5b13d7705e8c3d02be7dbc36f65a749 /src/quick | |
parent | 76a62c91ed30af73bfaedf651164d13986cc8519 (diff) |
Transition: Avoid potential extra QList detach
There might be potential extra QList detach due to the use of non-const
QList iterators in QQuickTransitionManager::transition(). To avoid
this, we can use QList::removeIf() which doesn't detach if there is
nothing to remove and also makes the code a bit clearer.
Change-Id: Ie3554ca9ea7397e6f14b46d10ea650d6a9019a9f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/util/qquicktransitionmanager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/util/qquicktransitionmanager.cpp b/src/quick/util/qquicktransitionmanager.cpp index efaa01c305..700e06a8ba 100644 --- a/src/quick/util/qquicktransitionmanager.cpp +++ b/src/quick/util/qquicktransitionmanager.cpp @@ -190,8 +190,8 @@ void QQuickTransitionManager::transition(const QList<QQuickStateAction> &list, } return false; }; - auto newEnd = std::remove_if(applyList.begin(), applyList.end(), isHandledInTransition); - applyList.erase(newEnd, applyList.end()); + + applyList.removeIf(isHandledInTransition); } // Any actions remaining have not been handled by the transition and should |