Last Comment Bug 676192 - Remove kHashEnumerateRemove and make nsHashtableEnumFunc return PRBool
: Remove kHashEnumerateRemove and make nsHashtableEnumFunc return PRBool
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla9
Assigned To: Michael Wu [:mwu]
:
Mentors:
Depends on: 675873
Blocks: 675553
  Show dependency treegraph
 
Reported: 2011-08-02 23:54 PDT by Michael Wu [:mwu]
Modified: 2011-08-23 01:42 PDT (History)
2 users (show)
mounir: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Fix (3.16 KB, patch)
2011-08-02 23:54 PDT, Michael Wu [:mwu]
benjamin: review+
Details | Diff | Review

Description Michael Wu [:mwu] 2011-08-02 23:54:49 PDT
Created attachment 550315 [details] [diff] [review]
Fix

As it turns out, most users of nsHashtable's Enumerate/Reset functions pass a callback that returns PRBool, not PRIntn. It looks like users typically use Reset() to delete entries instead of Enumerate so there is little need to pass anything other than true/false. There was only one user which actually used PRIntn/kHashEnumerateRemove, and I've converted that user to nsClassHashtable in bug 675873.
Comment 1 Benjamin Smedberg [:bsmedberg] 2011-08-15 07:50:31 PDT
Comment on attachment 550315 [details] [diff] [review]
Fix

Can we just remove nsHashtable?
Comment 2 Michael Wu [:mwu] 2011-08-22 02:11:28 PDT
(In reply to Benjamin Smedberg  [:bsmedberg] from comment #1)
> Comment on attachment 550315 [details] [diff] [review]
> Fix
> 
> Can we just remove nsHashtable?

There's enough users that it's hard to do manually, but maybe automated rewrites can help.
Comment 4 Mounir Lamouri (:mounir) 2011-08-23 01:42:46 PDT
http://hg.mozilla.org/mozilla-central/rev/09a0af24837d

Note You need to log in before you can comment on or make changes to this bug.