Backed out changeset 371a03aa9b24 (bug 1397056) for build errors in SmallPointerArray.h a=backout CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Tue, 12 Sep 2017 12:39:09 -0700
changeset 429841 9e7cdda04cbfc5d4dae19e071498d3351923196e
parent 429840 2d0d78a70953c589f5c62f527f7f95881492d3a6
child 429842 9d8ac1db50555b2b91d1aa16dadb8565513a8900
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1397056
milestone57.0a1
backs out371a03aa9b2469730b3fa300509eaeeb2ba5e255
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 371a03aa9b24 (bug 1397056) for build errors in SmallPointerArray.h a=backout CLOSED TREE MozReview-Commit-ID: FNVPjKmVCWB
mfbt/SmallPointerArray.h
mfbt/tests/TestSmallPointerArray.cpp
testing/cppunittest.ini
--- a/mfbt/SmallPointerArray.h
+++ b/mfbt/SmallPointerArray.h
@@ -91,70 +91,44 @@ public:
       mInlineElements[1] = aElement;
       return;
     }
 
     mArray = new std::vector<T*>({ mInlineElements[0], mInlineElements[1], aElement });
     mInlineElements[0] = nullptr;
   }
 
-  bool RemoveElement(T* aElement) {
+  void RemoveElement(T* aElement) {
     MOZ_ASSERT(aElement != nullptr);
     if (aElement == nullptr) {
-      return false;
+      return;
     }
 
     if (mInlineElements[0] == aElement) {
       // Expectected case.
       mInlineElements[0] = mInlineElements[1];
       mInlineElements[1] = nullptr;
-      return true;
+      return;
     }
 
     if (mInlineElements[0]) {
       if (mInlineElements[1] == aElement) {
         mInlineElements[1] = nullptr;
-        return true;
       }
-      return false;
+      return;
     }
 
     if (mArray) {
       for (auto iter = mArray->begin(); iter != mArray->end(); iter++) {
         if (*iter == aElement) {
           mArray->erase(iter);
-          return true;
+          return;
         }
       }
     }
-    return false;
-  }
-
-  bool Contains(T* aElement) const {
-    MOZ_ASSERT(aElement != nullptr);
-    if (aElement == nullptr) {
-      return false;
-    }
-
-    if (mInlineElements[0] == aElement) {
-      return true;
-    }
-
-    if (mInlineElements[0]) {
-      if (mInlineElements[1] == aElement) {
-        return true;
-      }
-      return false;
-    }
-
-    if (mArray) {
-      return std::find(mArray->begin(), mArray->end(), aElement) != mArray->end();
-    }
-    return false;
-
   }
 
   size_t Length() const
   {
     if (mInlineElements[0]) {
       if (!mInlineElements[1]) {
         return 1;
       }
--- a/mfbt/tests/TestSmallPointerArray.cpp
+++ b/mfbt/tests/TestSmallPointerArray.cpp
@@ -14,77 +14,70 @@
 // switches to the storage method used for larger arrays.
 void TestArrayManipulation()
 {
   using namespace mozilla;
   SmallPointerArray<void> testArray;
 
   MOZ_RELEASE_ASSERT(testArray.Length() == 0);
   MOZ_RELEASE_ASSERT(sizeof(testArray) == 2 * sizeof(void*));
-  MOZ_RELEASE_ASSERT(!testArray.Contains(PTR1));
 
   testArray.AppendElement(PTR1);
 
   MOZ_RELEASE_ASSERT(testArray.Length() == 1);
   MOZ_RELEASE_ASSERT(testArray[0] == PTR1);
   MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR1);
-  MOZ_RELEASE_ASSERT(testArray.Contains(PTR1));
 
   testArray.AppendElement(PTR2);
 
   MOZ_RELEASE_ASSERT(testArray.Length() == 2);
   MOZ_RELEASE_ASSERT(testArray[0] == PTR1);
   MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR1);
   MOZ_RELEASE_ASSERT(testArray[1] == PTR2);
   MOZ_RELEASE_ASSERT(testArray.ElementAt(1) == PTR2);
-  MOZ_RELEASE_ASSERT(testArray.Contains(PTR2));
 
-  MOZ_RELEASE_ASSERT(testArray.RemoveElement(PTR1));
-  MOZ_RELEASE_ASSERT(!testArray.RemoveElement(PTR1));
+  testArray.RemoveElement(PTR1);
 
   MOZ_RELEASE_ASSERT(testArray.Length() == 1);
   MOZ_RELEASE_ASSERT(testArray[0] == PTR2);
   MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR2);
-  MOZ_RELEASE_ASSERT(!testArray.Contains(PTR1));
 
   testArray.AppendElement(PTR1);
 
   MOZ_RELEASE_ASSERT(testArray.Length() == 2);
   MOZ_RELEASE_ASSERT(testArray[0] == PTR2);
   MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR2);
   MOZ_RELEASE_ASSERT(testArray[1] == PTR1);
   MOZ_RELEASE_ASSERT(testArray.ElementAt(1) == PTR1);
-  MOZ_RELEASE_ASSERT(testArray.Contains(PTR1));
 
   testArray.AppendElement(PTR3);
 
   MOZ_RELEASE_ASSERT(testArray.Length() == 3);
   MOZ_RELEASE_ASSERT(testArray[0] == PTR2);
   MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR2);
   MOZ_RELEASE_ASSERT(testArray[1] == PTR1);
   MOZ_RELEASE_ASSERT(testArray.ElementAt(1) == PTR1);
   MOZ_RELEASE_ASSERT(testArray[2] == PTR3);
   MOZ_RELEASE_ASSERT(testArray.ElementAt(2) == PTR3);
-  MOZ_RELEASE_ASSERT(testArray.Contains(PTR3));
 
-  MOZ_RELEASE_ASSERT(testArray.RemoveElement(PTR1));
+  testArray.RemoveElement(PTR1);
 
   MOZ_RELEASE_ASSERT(testArray.Length() == 2);
   MOZ_RELEASE_ASSERT(testArray[0] == PTR2);
   MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR2);
   MOZ_RELEASE_ASSERT(testArray[1] == PTR3);
   MOZ_RELEASE_ASSERT(testArray.ElementAt(1) == PTR3);
 
-  MOZ_RELEASE_ASSERT(testArray.RemoveElement(PTR2));
+  testArray.RemoveElement(PTR2);
 
   MOZ_RELEASE_ASSERT(testArray.Length() == 1);
   MOZ_RELEASE_ASSERT(testArray[0] == PTR3);
   MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR3);
 
-  MOZ_RELEASE_ASSERT(testArray.RemoveElement(PTR3));
+  testArray.RemoveElement(PTR3);
 
   MOZ_RELEASE_ASSERT(testArray.Length() == 0);
 
   testArray.Clear();
 
   MOZ_RELEASE_ASSERT(testArray.Length() == 0);
 
   testArray.AppendElement(PTR1);
@@ -96,23 +89,23 @@ void TestArrayManipulation()
   testArray.AppendElement(PTR2);
 
   MOZ_RELEASE_ASSERT(testArray.Length() == 2);
   MOZ_RELEASE_ASSERT(testArray[0] == PTR1);
   MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR1);
   MOZ_RELEASE_ASSERT(testArray[1] == PTR2);
   MOZ_RELEASE_ASSERT(testArray.ElementAt(1) == PTR2);
 
-  MOZ_RELEASE_ASSERT(testArray.RemoveElement(PTR2));
+  testArray.RemoveElement(PTR2);
 
   MOZ_RELEASE_ASSERT(testArray.Length() == 1);
   MOZ_RELEASE_ASSERT(testArray[0] == PTR1);
   MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR1);
 
-  MOZ_RELEASE_ASSERT(!testArray.RemoveElement(PTR3));
+  testArray.RemoveElement(PTR3);
 
   MOZ_RELEASE_ASSERT(testArray.Length() == 1);
   MOZ_RELEASE_ASSERT(testArray[0] == PTR1);
   MOZ_RELEASE_ASSERT(testArray.ElementAt(0) == PTR1);
 }
 
 void TestRangeBasedLoops()
 {
--- a/testing/cppunittest.ini
+++ b/testing/cppunittest.ini
@@ -33,17 +33,16 @@ skip-if = os == 'b2g'  #Bug 1038197
 [TestPair]
 [TestPoisonArea]
 skip-if = os == 'android' # Bug 1147630
 [TestRefPtr]
 [TestRollingMean]
 [TestScopeExit]
 [TestSegmentedVector]
 [TestSHA1]
-[TestSmallPointerArray]
 [TestSaturate]
 [TestSplayTree]
 [TestSyncRunnable]
 [TestTemplateLib]
 [TestTuple]
 [TestTypeTraits]
 [TestTypedEnum]
 [TestUniquePtr]