Closed Bug 1009263 Opened 10 years ago Closed 10 years ago

nsCheapSet needs an efficient method for removing all entries

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

References

Details

Attachments

(1 file)

The only way to remove all entries today is to call EnumerateEntries and
return PL_DHASH_REMOVE, which isn't efficient, and it also wastes memory
by retaining the internal hashtable so it fails to deliver on its promise
in the documentation that claims:
 * A set that takes up minimal size when there are 0 or 1 entries in the set.
Think I might work on this, if you weren't planning to.
Assignee: nobody → mz_mhs-ctb
Thanks, but I think the code that's already there in the destructor might work
as is, just needed to set mState = ZERO at the end.
Blocks: 1009282
Attachment #8421357 - Flags: review?(benjamin)
Assignee: mz_mhs-ctb → matspal
Attachment #8421357 - Flags: review?(benjamin) → review+
https://hg.mozilla.org/mozilla-central/rev/833768f88824
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: