Backed out changeset 721e3171510d (bug 1310547)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sat, 29 Oct 2016 13:45:28 +0200
changeset 320140 0e4c28cbee9c44b1e1a97846212f03f95f4b11fb
parent 320139 ac349d1b3c10546da0193046d6ce4b7f065eb070
child 320141 b38d9a1cd7995c1cf79d7fc9e5351839a1a2d95c
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1310547
milestone52.0a1
backs out721e3171510dcea7d92a911a6a4e285e757bfcc0
Backed out changeset 721e3171510d (bug 1310547)
mfbt/LinkedList.h
mfbt/tests/TestLinkedList.cpp
--- a/mfbt/LinkedList.h
+++ b/mfbt/LinkedList.h
@@ -246,40 +246,16 @@ public:
     mNext->mPrev = mPrev;
     mNext = this;
     mPrev = this;
 
     Traits::exitList(this);
   }
 
   /*
-   * Remove this element from the list containing it.  Returns a pointer to the
-   * element that follows this element (before it was removed).  This method
-   * asserts if the element does not belong to a list.
-   */
-  ClientType removeAndGetNext()
-  {
-    ClientType r = getNext();
-    remove();
-    return r;
-  }
-
-  /*
-   * Remove this element from the list containing it.  Returns a pointer to the
-   * previous element in the containing list (before the removal).  This method
-   * asserts if the element does not belong to a list.
-   */
-  ClientType removeAndGetPrevious()
-  {
-    ClientType r = getPrevious();
-    remove();
-    return r;
-  }
-
-  /*
    * Identical to remove(), but also asserts in debug builds that this element
    * is in aList.
    */
   void removeFrom(const LinkedList<T>& aList)
   {
     aList.assertContains(asT());
     remove();
   }
--- a/mfbt/tests/TestLinkedList.cpp
+++ b/mfbt/tests/TestLinkedList.cpp
@@ -151,34 +151,16 @@ TestMove()
   LinkedList<SomeClass> list3;
   list3 = Move(list2);
   { unsigned int check[] { 1, 2 }; CheckListValues(list3, check); }
   MOZ_RELEASE_ASSERT(list2.isEmpty());
 
   list3.clear();
 }
 
-static void
-TestRemoveAndGet()
-{
-  LinkedList<SomeClass> list;
-
-  SomeClass one(1), two(2), three(3);
-  list.insertBack(&one);
-  list.insertBack(&two);
-  list.insertBack(&three);
-  { unsigned int check[] { 1, 2, 3 }; CheckListValues(list, check); }
-
-  MOZ_RELEASE_ASSERT(two.removeAndGetNext() == &three);
-  { unsigned int check[] { 1, 3 }; CheckListValues(list, check); }
-
-  MOZ_RELEASE_ASSERT(three.removeAndGetPrevious() == &one);
-  { unsigned int check[] { 1 }; CheckListValues(list, check); }
-}
-
 struct PrivateClass : private LinkedListElement<PrivateClass> {
   friend class mozilla::LinkedList<PrivateClass>;
   friend class mozilla::LinkedListElement<PrivateClass>;
 };
 
 static void
 TestPrivate()
 {
@@ -257,12 +239,11 @@ TestRefPtrList()
 }
 
 int
 main()
 {
   TestList();
   TestPrivate();
   TestMove();
-  TestRemoveAndGet();
   TestRefPtrList();
   return 0;
 }