Bug 1290587, part 6 - Remove unused method NativeSetMap::Add. r=mrbkap
authorAndrew McCreight <continuation@gmail.com>
Fri, 29 Jul 2016 10:47:52 -0700
changeset 395273 4c2020735c691fb5bccba2439053da71d6355776
parent 395272 4dff23362d43e875e2ec549e8584ff973d25fb69
child 395274 392d902c517d4078b8b4a92bf562366a06bcea96
push id24732
push userbmo:gps@mozilla.com
push dateMon, 01 Aug 2016 21:50:09 +0000
reviewersmrbkap
bugs1290587
milestone50.0a1
Bug 1290587, part 6 - Remove unused method NativeSetMap::Add. r=mrbkap Also convert some NS_PRECONDITION in NativeSetMap. MozReview-Commit-ID: IU9C5oXKvGK
js/xpconnect/src/XPCMaps.h
--- a/js/xpconnect/src/XPCMaps.h
+++ b/js/xpconnect/src/XPCMaps.h
@@ -397,36 +397,30 @@ public:
     inline XPCNativeSet* Find(XPCNativeSetKey* key)
     {
         auto entry = static_cast<Entry*>(mTable.Search(key));
         return entry ? entry->key_value : nullptr;
     }
 
     inline XPCNativeSet* Add(const XPCNativeSetKey* key, XPCNativeSet* set)
     {
-        NS_PRECONDITION(key,"bad param");
-        NS_PRECONDITION(set,"bad param");
+        MOZ_ASSERT(key, "bad param");
+        MOZ_ASSERT(set, "bad param");
         auto entry = static_cast<Entry*>(mTable.Add(key, mozilla::fallible));
         if (!entry)
             return nullptr;
         if (entry->key_value)
             return entry->key_value;
         entry->key_value = set;
         return set;
     }
 
-    inline XPCNativeSet* Add(XPCNativeSet* set)
-    {
-        XPCNativeSetKey key(set, nullptr, 0);
-        return Add(&key, set);
-    }
-
     inline void Remove(XPCNativeSet* set)
     {
-        NS_PRECONDITION(set,"bad param");
+        MOZ_ASSERT(set, "bad param");
 
         XPCNativeSetKey key(set, nullptr, 0);
         mTable.Remove(&key);
     }
 
     inline uint32_t Count() { return mTable.EntryCount(); }
 
     PLDHashTable::Iterator Iter() { return mTable.Iter(); }