Closed
Bug 1376468
Opened 7 years ago
Closed 7 years ago
ProgressTracker::RemoveObserver does unnecessary hashtable lookups
Categories
(Core :: Graphics: ImageLib, enhancement, P3)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla56
Tracking | Status | |
---|---|---|
firefox56 | --- | fixed |
People
(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)
References
Details
(Keywords: perf)
Attachments
(1 file)
1.10 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•7 years ago
|
||
Attachment #8881411 -
Flags: review?(nfroyd)
Comment 2•7 years ago
|
||
Comment on attachment 8881411 [details] [diff] [review] Use Lookup instead of Get+Remove to avoid unnecessary hashtable lookups Review of attachment 8881411 [details] [diff] [review]: ----------------------------------------------------------------- ::: image/ProgressTracker.cpp @@ +472,5 @@ > // Remove the observer from the list. > bool removed = mObservers.Write([=](ObserverTable* aTable) { > + if (auto entry = aTable->Lookup(observer)) { > + entry.Remove(); > + return true; Another valid use case for Remove() having a useful return value.
Attachment #8881411 -
Flags: review?(nfroyd) → review+
Pushed by mpalmgren@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/1cccacc0f442 Use Lookup instead of Get+Remove to avoid unnecessary hashtable lookups. r=froydnj
Comment 4•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1cccacc0f442
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in
before you can comment on or make changes to this bug.
Description
•