зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset e3352dc9d701 (bug 1404897)
This commit is contained in:
Родитель
635c45113c
Коммит
636468f6d3
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче