зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1376126 - Use Lookup() entry instead of Get+Remove in CycleCollectedJSRuntime::RemoveJSHolder to avoid unnecessary hashtable lookups. r=froydnj
MozReview-Commit-ID: F2dJbf9r44b
This commit is contained in:
Родитель
b9f0924f9a
Коммит
250c9d87b0
|
@ -1101,12 +1101,10 @@ struct ClearJSHolder : public TraceCallbacks
|
|||
void
|
||||
CycleCollectedJSRuntime::RemoveJSHolder(void* aHolder)
|
||||
{
|
||||
nsScriptObjectTracer* tracer = mJSHolders.Get(aHolder);
|
||||
if (!tracer) {
|
||||
return;
|
||||
if (auto entry = mJSHolders.Lookup(aHolder)) {
|
||||
entry.Data()->Trace(aHolder, ClearJSHolder(), nullptr);
|
||||
entry.Remove();
|
||||
}
|
||||
tracer->Trace(aHolder, ClearJSHolder(), nullptr);
|
||||
mJSHolders.Remove(aHolder);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
Загрузка…
Ссылка в новой задаче