While working on Bug 131631, we noticed a few improvements that could be made once the Vector class had been updated with additional move-handling operators. 1. Use "someVector.last()" rather than "someVector[someVector.size() - 1]" 2. Use Vectors "takeLast()" method, rather than the hand-coded implementation in these classes.
Created attachment 229517 [details] Patch
Comment on attachment 229517 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=229517&action=review > Source/WebCore/platform/win/WCDataObject.cpp:361 > + m_formats[ptr] = std::move(m_formats.last()); > m_formats.removeLast(); Should be takeLast, not last/removeLast. > Source/WebCore/platform/win/WCDataObject.cpp:363 > + m_medium[ptr] = std::move(m_medium.last()); > m_medium.removeLast(); Should be takeLast, not last/removeLast. > Tools/DumpRenderTree/win/DRTDataObject.cpp:350 > + m_formats[position] = std::move(m_formats.last()); > m_formats.removeLast(); Should be takeLast, not last/removeLast. > Tools/DumpRenderTree/win/DRTDataObject.cpp:352 > + m_medium[position] = std::move(m_medium.last()); > m_medium.removeLast(); Should be takeLast, not last/removeLast.
Created attachment 229559 [details] Whoops! Left some unrelated debugging code in my tree.
Anders, do I need to add a std::move() in these uses of takeLast to ensure proper move semantics?
Created attachment 229560 [details] Patch
Committed r167442: <http://trac.webkit.org/changeset/167442>