Closed Bug 1371961 Opened 2 years ago Closed 2 years ago

imgLoader::RemoveFromCache does unnecessary hashtable lookups

Categories

(Core :: ImageLib, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: mats, Assigned: mats)

Details

(Keywords: perf)

Attachments

(1 file, 1 obsolete file)

No description provided.
I doubt |aValue| can ever be null when we found an entry to remove,
but let's be conservative and do minimal changes here.
Attachment #8876447 - Flags: review?(nfroyd)
Comment on attachment 8876447 [details] [diff] [review]
Use LookupRemoveIf instead of Get+Remove to avoid unnecessary hashtable lookups

Actually, nsRefPtrHashtable::Remove(KeyType aKey, UserDataType* aData)
might be a better choice here...
Attachment #8876447 - Flags: review?(nfroyd)
Attachment #8876448 - Flags: review?(nfroyd) → review+
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2b8c8bc6ba8b
Use nsRefPtrHashtable::Remove instead of Get + nsBaseHashtable::Remove to avoid unnecessary hashtable lookups.  r=froydnj
https://hg.mozilla.org/mozilla-central/rev/2b8c8bc6ba8b
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.