Bug 1290587, part 6 - Remove unused method NativeSetMap::Add. r=mrbkap draft
authorAndrew McCreight <continuation@gmail.com>
Fri, 29 Jul 2016 10:47:52 -0700
changeset 394788 b861ff46d7542964fb8dd559994d3420665fafd0
parent 394787 db5ef32b7631527617e3cc391cb7a6ceccb9f019
child 394789 23b6213f67f7015036d7d2dafbb6de766579b107
push id24631
push userbmo:continuation@gmail.com
push dateSun, 31 Jul 2016 18:47:25 +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(); }