Title: [157606] trunk/Source/WTF
Revision
157606
Author
gga...@apple.com
Date
2013-10-17 15:10:36 -0700 (Thu, 17 Oct 2013)

Log Message

Tidied up the Vector<T> move constructor
https://bugs.webkit.org/show_bug.cgi?id=122998

Reviewed by Anders Carlsson.

* wtf/Vector.h:
(WTF::::Vector): Don't call swap() "weird". It's the way most std types
implement move constructors.

Do inline this function, so the compiler can optimize away a logical
move into a physical no-op.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (157605 => 157606)


--- trunk/Source/WTF/ChangeLog	2013-10-17 22:08:18 UTC (rev 157605)
+++ trunk/Source/WTF/ChangeLog	2013-10-17 22:10:36 UTC (rev 157606)
@@ -1,3 +1,17 @@
+2013-10-17  Geoffrey Garen  <gga...@apple.com>
+
+        Tidied up the Vector<T> move constructor
+        https://bugs.webkit.org/show_bug.cgi?id=122998
+
+        Reviewed by Anders Carlsson.
+
+        * wtf/Vector.h:
+        (WTF::::Vector): Don't call swap() "weird". It's the way most std types
+        implement move constructors.
+
+        Do inline this function, so the compiler can optimize away a logical
+        move into a physical no-op.
+
 2013-10-16  Filip Pizlo  <fpi...@apple.com>
 
         Introduce WTF::Bag and start using it for InlineCallFrameSet

Modified: trunk/Source/WTF/wtf/Vector.h (157605 => 157606)


--- trunk/Source/WTF/wtf/Vector.h	2013-10-17 22:08:18 UTC (rev 157605)
+++ trunk/Source/WTF/wtf/Vector.h	2013-10-17 22:10:36 UTC (rev 157606)
@@ -772,15 +772,13 @@
 }
 
 template<typename T, size_t inlineCapacity, typename OverflowHandler>
-Vector<T, inlineCapacity, OverflowHandler>::Vector(Vector<T, inlineCapacity, OverflowHandler>&& other)
+inline Vector<T, inlineCapacity, OverflowHandler>::Vector(Vector<T, inlineCapacity, OverflowHandler>&& other)
 {
-    // It's a little weird to implement a move constructor using swap but this way we
-    // don't have to add a move constructor to VectorBuffer.
     swap(other);
 }
 
 template<typename T, size_t inlineCapacity, typename OverflowHandler>
-Vector<T, inlineCapacity, OverflowHandler>& Vector<T, inlineCapacity, OverflowHandler>::operator=(Vector<T, inlineCapacity, OverflowHandler>&& other)
+inline Vector<T, inlineCapacity, OverflowHandler>& Vector<T, inlineCapacity, OverflowHandler>::operator=(Vector<T, inlineCapacity, OverflowHandler>&& other)
 {
     swap(other);
     return *this;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to