Title: [250626] trunk/Source/WebCore
Revision
250626
Author
[email protected]
Date
2019-10-02 13:48:51 -0700 (Wed, 02 Oct 2019)

Log Message

Adopt copyToVector() in AnimationTimeline::animationsForElement()
https://bugs.webkit.org/show_bug.cgi?id=202488

Patch by Antoine Quint <[email protected]> on 2019-10-02
Reviewed by Wenson Hsieh.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::animationsForElement const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (250625 => 250626)


--- trunk/Source/WebCore/ChangeLog	2019-10-02 20:35:03 UTC (rev 250625)
+++ trunk/Source/WebCore/ChangeLog	2019-10-02 20:48:51 UTC (rev 250626)
@@ -1,3 +1,13 @@
+2019-10-02  Antoine Quint  <[email protected]>
+
+        Adopt copyToVector() in AnimationTimeline::animationsForElement()
+        https://bugs.webkit.org/show_bug.cgi?id=202488
+
+        Reviewed by Wenson Hsieh.
+
+        * animation/AnimationTimeline.cpp:
+        (WebCore::AnimationTimeline::animationsForElement const):
+
 2019-10-02  Thibault Saunier  <[email protected]>
 
         [GStreamer] Let playbin handle redirects for us when appropriate

Modified: trunk/Source/WebCore/animation/AnimationTimeline.cpp (250625 => 250626)


--- trunk/Source/WebCore/animation/AnimationTimeline.cpp	2019-10-02 20:35:03 UTC (rev 250625)
+++ trunk/Source/WebCore/animation/AnimationTimeline.cpp	2019-10-02 20:48:51 UTC (rev 250626)
@@ -170,8 +170,7 @@
     if (m_elementToCSSTransitionsMap.contains(&element)) {
         const auto& cssTransitions = m_elementToCSSTransitionsMap.get(&element);
         if (ordering == Ordering::Sorted) {
-            Vector<RefPtr<WebAnimation>> sortedCSSTransitions;
-            sortedCSSTransitions.appendRange(cssTransitions.begin(), cssTransitions.end());
+            auto sortedCSSTransitions = copyToVector(cssTransitions);
             std::sort(sortedCSSTransitions.begin(), sortedCSSTransitions.end(), [](auto& lhs, auto& rhs) {
                 // Sort transitions first by their generation time, and then by transition-property.
                 // https://drafts.csswg.org/css-transitions-2/#animation-composite-order
@@ -192,8 +191,7 @@
     if (m_elementToAnimationsMap.contains(&element)) {
         const auto& webAnimations = m_elementToAnimationsMap.get(&element);
         if (ordering == Ordering::Sorted) {
-            Vector<RefPtr<WebAnimation>> sortedWebAnimations;
-            sortedWebAnimations.appendRange(webAnimations.begin(), webAnimations.end());
+            auto sortedWebAnimations = copyToVector(webAnimations);
             std::sort(sortedWebAnimations.begin(), sortedWebAnimations.end(), [](auto& lha, auto& rha) {
                 return lha->globalPosition() < rha->globalPosition();
             });
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to