[Win] A few final cleanups to the DataObject classes.
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Apr 2014 18:14:12 +0000 (18:14 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Apr 2014 18:14:12 +0000 (18:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=131784

Reviewed by Anders Carlsson.

Source/WebCore:
* platform/win/WCDataObject.cpp:
(WebCore::WCDataObject::clearData): Use 'last()' method.

Tools:
* DumpRenderTree/win/DRTDataObject.cpp:
(DRTDataObject::clearData): Use 'last()' method.
* DumpRenderTree/win/UIDelegate.cpp:
(DRTUndoStack::pop): Use 'takeLast()' method.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167442 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/win/WCDataObject.cpp
Tools/ChangeLog
Tools/DumpRenderTree/win/DRTDataObject.cpp
Tools/DumpRenderTree/win/UIDelegate.cpp

index 1439b46..4aa9bac 100644 (file)
@@ -1,3 +1,13 @@
+2014-04-16  Brent Fulgham  <bfulgham@apple.com>
+
+        [Win] A few final cleanups to the DataObject classes.
+        https://bugs.webkit.org/show_bug.cgi?id=131784
+
+        Reviewed by Anders Carlsson.
+
+        * platform/win/WCDataObject.cpp:
+        (WebCore::WCDataObject::clearData): Use 'last()' method.
+
 2014-04-15  Jer Noble  <jer.noble@apple.com>
 
         Fullscreen media controls are unusable in pagination mode
index 17d1900..25dee14 100644 (file)
@@ -357,10 +357,8 @@ void WCDataObject::clearData(CLIPFORMAT format)
     size_t ptr = 0;
     while (ptr < m_formats.size()) {
         if (m_formats[ptr]->cfFormat == format) {
-            m_formats[ptr] = std::move(m_formats[m_formats.size() - 1]);
-            m_formats.removeLast();
-            m_medium[ptr] = std::move(m_medium[m_medium.size() - 1]);
-            m_medium.removeLast();
+            m_formats[ptr] = m_formats.takeLast();
+            m_medium[ptr] = m_medium.takeLast();
             continue;
         }
         ptr++;
index 6076ecd..369503c 100644 (file)
@@ -1,3 +1,15 @@
+2014-04-16  Brent Fulgham  <bfulgham@apple.com>
+
+        [Win] A few final cleanups to the DataObject classes.
+        https://bugs.webkit.org/show_bug.cgi?id=131784
+
+        Reviewed by Anders Carlsson.
+
+        * DumpRenderTree/win/DRTDataObject.cpp:
+        (DRTDataObject::clearData): Use 'last()' method.
+        * DumpRenderTree/win/UIDelegate.cpp:
+        (DRTUndoStack::pop): Use 'takeLast()' method.
+
 2014-04-17  Andres Gomez  <agomez@igalia.com>
 
         [Win] cygwin to keep installing curl 7.33.0-1 and subversion 1.7.14-1
index b7b2279..0a6d964 100644 (file)
@@ -346,10 +346,8 @@ void DRTDataObject::clearData(CLIPFORMAT format)
     size_t position = 0;
     while (position < m_formats.size()) {
         if (m_formats[position]->cfFormat == format) {
-            m_formats[position] = std::move(m_formats[m_formats.size() - 1]);
-            m_formats.removeLast();
-            m_medium[position] = std::move(m_medium[m_medium.size() - 1]);
-            m_medium.removeLast();
+            m_formats[position] = m_formats.takeLast();
+            m_medium[position] = m_medium.takeLast();
             continue;
         }
         position++;
index 4f9dc01..7a128c8 100644 (file)
@@ -76,7 +76,7 @@ public:
     void clear() { m_undoVector.clear(); }
 
     void push(DRTUndoObject* undoObject) { m_undoVector.append(undoObject); }
-    std::unique_ptr<DRTUndoObject> pop() { std::unique_ptr<DRTUndoObject> top = std::move(m_undoVector.last()); m_undoVector.removeLast(); return std::move(top); }
+    std::unique_ptr<DRTUndoObject> pop() { return m_undoVector.takeLast(); }
 
 private:
     Vector<std::unique_ptr<DRTUndoObject>> m_undoVector;