Closed Bug 1371961 Opened 7 years ago Closed 7 years ago

imgLoader::RemoveFromCache does unnecessary hashtable lookups

Categories

(Core :: Graphics: ImageLib, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

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: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: