mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 04:09:50 +00:00
Bug 1787974 - Do a linear search in RemoveTimerInternal to stop going through the holder r=smaug
Note that it's about 4 times slower in practice! But this will be balanced in later patches. Differential Revision: https://phabricator.services.mozilla.com/D164285
This commit is contained in:
parent
bfb631bb92
commit
fdae1596bd
@ -835,8 +835,14 @@ bool TimerThread::RemoveTimerInternal(nsTimerImpl* aTimer) {
|
||||
return false;
|
||||
}
|
||||
AUTO_TIMERS_STATS(TimerThread_RemoveTimerInternal_in_list);
|
||||
aTimer->mHolder->Forget(aTimer);
|
||||
return true;
|
||||
for (auto& entry : mTimers) {
|
||||
if (entry->Value() == aTimer) {
|
||||
entry->Forget(aTimer);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
MOZ_ASSERT(!aTimer->mHolder, "There is a holder, but timer is not in list!?");
|
||||
return false;
|
||||
}
|
||||
|
||||
void TimerThread::RemoveLeadingCanceledTimersInternal() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user