Bug 1311277 Part 3 - Use LinkedList's move assignment in FCItemIterator::AppendItemsToList. draft
authorTing-Yu Lin <tlin@mozilla.com>
Wed, 19 Oct 2016 13:56:12 +0800
changeset 427905 0bb8470f53174e4a1f8196f2433576846f1e1801
parent 427904 fd317ce1e4073965ec8afba1366d66a7675a7203
child 427906 25729537a35661ca01802cee8da59c38eabdbe1a
push id33159
push userbmo:tlin@mozilla.com
push dateFri, 21 Oct 2016 03:26:06 +0000
bugs1311277
milestone52.0a1
Bug 1311277 Part 3 - Use LinkedList's move assignment in FCItemIterator::AppendItemsToList. MozReview-Commit-ID: LLF519q9gcG
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -12808,21 +12808,17 @@ Iterator::AppendItemsToList(const Iterat
       !aTargetList.mUndisplayedItems.IsEmpty()) {
     do {
       AppendItemToList(aTargetList);
     } while (*this != aEnd);
     return;
   }
 
   // Move our entire list of items into the empty target list.
-  // XXX: If LinkedList supports move assignment, we could use
-  // aTargetList.mItems = Move(mList.mItems);
-  aTargetList.mItems.~LinkedList<FrameConstructionItem>();
-  new (&aTargetList.mItems) LinkedList<FrameConstructionItem>(
-    Move(mList.mItems));
+  aTargetList.mItems = Move(mList.mItems);
 
   // Copy over the various counters
   aTargetList.mInlineCount = mList.mInlineCount;
   aTargetList.mBlockCount = mList.mBlockCount;
   aTargetList.mLineParticipantCount = mList.mLineParticipantCount;
   aTargetList.mItemCount = mList.mItemCount;
   memcpy(aTargetList.mDesiredParentCounts, mList.mDesiredParentCounts,
          sizeof(aTargetList.mDesiredParentCounts));