Closed Bug 1289550 Opened 8 years ago Closed 8 years ago

Remove "fun little hack" from XPCNativeSetKey

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

Details

Attachments

(1 file, 1 obsolete file)

XPCNativeSetKey has a huge comment about this weird hack it does, where it tags the first 16 bytes with a magic value. The purpose of this seem to be that PLDHashtable used to require that the Match() operation handle both the desired "key" type and the actual entry type (NativeSetMap::Entry in this case), with the latter needed for resizing. However, that duality in the match operation has not been needed since bug 374906, which landed in 2007, so this class can be greatly simplified.
IsAKey() can be replaced with true, which simplifies some hash
operations.
HashNativeKey is also only called with the key type.

try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=de6442645240
Attachment #8775206 - Flags: review?(bzbarsky)
Attachment #8774874 - Attachment is obsolete: true
Comment on attachment 8775206 [details] [diff] [review]
Remove "fun little hack" from XPCNativeSetKey.

r=me, I think.
Attachment #8775206 - Flags: review?(bzbarsky) → review+
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8830f07a659b
Remove "fun little hack" from XPCNativeSetKey. r=bz
https://hg.mozilla.org/mozilla-central/rev/8830f07a659b
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: