Bug 1290587, part 6 - Remove unused method NativeSetMap::Add. r=mrbkap
Also convert some NS_PRECONDITION in NativeSetMap.
MozReview-Commit-ID: IU9C5oXKvGK
--- 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(); }