From 636468f6d3656d48ebae9f485c85d9d2f221799d Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Wed, 4 Oct 2017 12:55:22 +0200 Subject: [PATCH] Backed out changeset e3352dc9d701 (bug 1404897) --- xpcom/ds/nsBaseHashtable.h | 27 ++------------------------- xpcom/ds/nsDataHashtable.h | 15 --------------- 2 files changed, 2 insertions(+), 40 deletions(-) diff --git a/xpcom/ds/nsBaseHashtable.h b/xpcom/ds/nsBaseHashtable.h index ed5b780685f7..1560b210e3bc 100644 --- a/xpcom/ds/nsBaseHashtable.h +++ b/xpcom/ds/nsBaseHashtable.h @@ -128,9 +128,10 @@ public: } /** - * Put a new value for the associated key + * put a new value for the associated key * @param aKey the key to put * @param aData the new data + * @return always true, unless memory allocation failed */ void Put(KeyType aKey, const UserDataType& aData) { @@ -152,30 +153,6 @@ public: return true; } - /** - * Put a new value for the associated key - * @param aKey the key to put - * @param aData the new data - */ - void Put(KeyType aKey, UserDataType&& aData) - { - if (!Put(aKey, mozilla::Move(aData), mozilla::fallible)) { - NS_ABORT_OOM(this->mTable.EntrySize() * this->mTable.EntryCount()); - } - } - - MOZ_MUST_USE bool Put(KeyType aKey, UserDataType&& aData, const fallible_t&) - { - EntryType* ent = this->PutEntry(aKey, mozilla::fallible); - if (!ent) { - return false; - } - - ent->mData = mozilla::Move(aData); - - return true; - } - /** * Remove the entry associated with aKey (if any), optionally _moving_ its * current value into *aData. Return true if found. diff --git a/xpcom/ds/nsDataHashtable.h b/xpcom/ds/nsDataHashtable.h index 7201b309cbde..19c0728b4a81 100644 --- a/xpcom/ds/nsDataHashtable.h +++ b/xpcom/ds/nsDataHashtable.h @@ -36,21 +36,6 @@ public: { } - /** - * Retrieve a reference to the value for a key. - * - * @param aKey the key to retrieve. - * @return a reference to the found value, or nullptr if no entry was found - * with the given key. - */ - DataType* GetValue(KeyType aKey) - { - if (EntryType* ent = this->GetEntry(aKey)) { - return &ent->mData; - } - return nullptr; - } - /** * Retrieve the value for a key and remove the corresponding entry at * the same time.