mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Backed out changeset 9389dd982590 (bug 1404897)
This commit is contained in:
parent
82e62e8f75
commit
2dbbc650a4
@ -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 aKey the key to put
|
||||||
* @param aData the new data
|
* @param aData the new data
|
||||||
|
* @return always true, unless memory allocation failed
|
||||||
*/
|
*/
|
||||||
void Put(KeyType aKey, const UserDataType& aData)
|
void Put(KeyType aKey, const UserDataType& aData)
|
||||||
{
|
{
|
||||||
@ -152,30 +153,6 @@ public:
|
|||||||
return true;
|
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
|
* Remove the entry associated with aKey (if any), optionally _moving_ its
|
||||||
* current value into *aData. Return true if found.
|
* current value into *aData. Return true if found.
|
||||||
|
@ -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
|
* Retrieve the value for a key and remove the corresponding entry at
|
||||||
* the same time.
|
* the same time.
|
||||||
|
Loading…
Reference in New Issue
Block a user