We should use Vector::swap() instead of std::move() to explicitly swap Vector objects in SVGDocumentExtensions::rebuildElements(). Currently we use std::move() to implicitly swap Vector objects. This is error prone as a const lvalue reference can bind to an rvalue so calling T t = std::move(t_1) <=> T t = t_1 <=> T t(t_1) where t_1 is const T&&.
<rdar://problem/17479854>
Created attachment 234024 [details] Patch and layout test
Comment on attachment 234024 [details] Patch and layout test I don’t think this is an improvement.
(In reply to comment #0) > Currently we use std::move() to implicitly swap Vector objects. No, we use it to move a vector. There is no swapping going on; we move the vector from the object into a local variable.
Comment on attachment 234024 [details] Patch and layout test Clearing review flag. After talking with Darin Adler and Anders Carlsson today (06/30), a better approach is to come up with a WTF::move() function that asserts we aren't called with a const value.
(In reply to comment #5) > (From update of attachment 234024 [details]) > Clearing review flag. After talking with Darin Adler and Anders Carlsson today (06/30), a better approach is to come up with a WTF::move() function that asserts we aren't called with a const value. Filed bug #134500 to add WTF::move(). I'll repurpose this bug for adding the layout test, included in attachment #234024 [details].
Created attachment 234378 [details] Layout test
Comment on attachment 234378 [details] Layout test r=me
Comment on attachment 234378 [details] Layout test Clearing flags on attachment: 234378 Committed r170847: <http://trac.webkit.org/changeset/170847>
All reviewed patches have been landed. Closing bug.