зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1376498 part 2 - Use plain Remove(key) in some places instead of Lookup(key).Remove() for simplicity. r=froydnj
MozReview-Commit-ID: 7GlCL1jyGAz
This commit is contained in:
Родитель
f88bb52a9e
Коммит
9542d00e58
|
@ -2085,10 +2085,7 @@ Console::StopTimer(JSContext* aCx, const JS::Value& aName,
|
|||
aTimerLabel = key;
|
||||
|
||||
DOMHighResTimeStamp value = 0;
|
||||
if (auto entry = mTimerRegistry.Lookup(key)) {
|
||||
value = entry.Data();
|
||||
entry.Remove();
|
||||
} else {
|
||||
if (!mTimerRegistry.Remove(key, &value)) {
|
||||
NS_WARNING("mTimerRegistry entry not found");
|
||||
return eTimerDoesntExist;
|
||||
}
|
||||
|
|
|
@ -5102,8 +5102,7 @@ void
|
|||
ContentParent::SendGetFilesResponseAndForget(const nsID& aUUID,
|
||||
const GetFilesResponseResult& aResult)
|
||||
{
|
||||
if (auto entry = mGetFilesPendingRequests.Lookup(aUUID)) {
|
||||
entry.Remove();
|
||||
if (mGetFilesPendingRequests.Remove(aUUID)) {
|
||||
Unused << SendGetFilesResponse(aUUID, aResult);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -698,9 +698,9 @@ gfxFontEntry::GrReleaseTable(const void *aAppFaceHandle,
|
|||
{
|
||||
gfxFontEntry *fontEntry =
|
||||
static_cast<gfxFontEntry*>(const_cast<void*>(aAppFaceHandle));
|
||||
if (auto entry = fontEntry->mGrTableMap->Lookup(aTableBuffer)) {
|
||||
hb_blob_destroy(static_cast<hb_blob_t*>(entry.Data()));
|
||||
entry.Remove();
|
||||
void* value;
|
||||
if (fontEntry->mGrTableMap->Remove(aTableBuffer, &value)) {
|
||||
hb_blob_destroy(static_cast<hb_blob_t*>(value));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -471,11 +471,7 @@ ProgressTracker::RemoveObserver(IProgressObserver* aObserver)
|
|||
|
||||
// Remove the observer from the list.
|
||||
bool removed = mObservers.Write([=](ObserverTable* aTable) {
|
||||
if (auto entry = aTable->Lookup(observer)) {
|
||||
entry.Remove();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return aTable->Remove(observer);
|
||||
});
|
||||
|
||||
// Observers can get confused if they don't get all the proper teardown
|
||||
|
|
|
@ -61,11 +61,7 @@ nsHashPropertyBagBase::SetProperty(const nsAString& aName, nsIVariant* aValue)
|
|||
NS_IMETHODIMP
|
||||
nsHashPropertyBagBase::DeleteProperty(const nsAString& aName)
|
||||
{
|
||||
if (auto entry = mPropertyHash.Lookup(aName)) {
|
||||
entry.Remove();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
return mPropertyHash.Remove(aName) ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -44,11 +44,7 @@ nsProperties::Undefine(const char* prop)
|
|||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
if (auto entry = nsProperties_HashBase::Lookup(prop)) {
|
||||
entry.Remove();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
return nsProperties_HashBase::Remove(prop) ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -271,11 +271,7 @@ nsDirectoryService::Undefine(const char* aProp)
|
|||
}
|
||||
|
||||
nsDependentCString key(aProp);
|
||||
if (auto entry = mHashtable.Lookup(key)) {
|
||||
entry.Remove();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
return mHashtable.Remove(key) ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -183,12 +183,10 @@ NS_IMETHODIMP
|
|||
nsWindowDataSource::OnCloseWindow(nsIXULWindow *window)
|
||||
{
|
||||
nsresult rv;
|
||||
auto entry = mWindowResources.Lookup(window);
|
||||
if (!entry) {
|
||||
nsCOMPtr<nsIRDFResource> resource;
|
||||
if (!mWindowResources.Remove(window, getter_AddRefs(resource))) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
nsCOMPtr<nsIRDFResource> resource(entry.Data().forget());
|
||||
entry.Remove();
|
||||
|
||||
// make sure we're not shutting down
|
||||
if (!mContainer) return NS_OK;
|
||||
|
|
Загрузка…
Ссылка в новой задаче