Closed Bug 1478879 Opened 6 years ago Closed 6 years ago

Introduce Iterator and ModIterator in HashTable.h

Categories

(Core :: MFBT, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

Attachments

(9 files)

Range and Enum are basically just iterators with non-standard names. This change will bring HashTable.h in line with PLDHashTable/nsTHashtable.
I was originally planning to remove Range and Enum, but I underestimated how widely they are used within SpiderMonkey. Furthermore, there are plenty of other FooRange classes for iterating over other data structures.

Changing all of those would take a bunch of time without providing that much value. So I plan to convert the few existing uses of Enum/Range outside of SpiderMonkey to Iterator/ModIterator -- for consistency with PLDHashTable/nsTHashtable -- but leave the ones within SpiderMonkey as is.
Comment on attachment 8996567 [details]
Bug 1478879 - Remove zero-arg constructor for Range.

https://reviewboard.mozilla.org/r/260672/#review267674
Attachment #8996567 - Flags: review?(continuation) → review+
mccr8: apologies, by accident I originally pushed just a single patch of the stack, which you then r+'d, but now with the full stack pushed MozReview wants you to r+ again.
Comment on attachment 8996578 [details]
Bug 1478879 - Remove Range/Enum use in Bench.cpp.

https://reviewboard.mozilla.org/r/260682/#review267738
Attachment #8996578 - Flags: review?(nfroyd) → review+
Comment on attachment 8996577 [details]
Bug 1478879 - Remove Range/Enum use in DMD.

https://reviewboard.mozilla.org/r/260680/#review267756
Attachment #8996577 - Flags: review?(continuation) → review+
Comment on attachment 8996579 [details]
Bug 1478879 - Remove Range/Enum use in dom/.

https://reviewboard.mozilla.org/r/260684/#review267758
Attachment #8996579 - Flags: review?(continuation) → review+
Comment on attachment 8996581 [details]
Bug 1478879 - Remove Range/Enum use in XPConnect.

https://reviewboard.mozilla.org/r/260688/#review267760
Attachment #8996581 - Flags: review?(continuation) → review+
Comment on attachment 8996567 [details]
Bug 1478879 - Remove zero-arg constructor for Range.

https://reviewboard.mozilla.org/r/260672/#review267780

Nice!
Attachment #8996567 - Flags: review?(luke) → review+
Comment on attachment 8996574 [details]
Bug 1478879 - Introduce Iterator and ModIterator in HashTable.h.

https://reviewboard.mozilla.org/r/260674/#review267782

Great!  I like the new names better.  It's also lovely, now that move semantics are a thing, to have modIter() return ModIterator by value.
Attachment #8996574 - Flags: review?(luke) → review+
Comment on attachment 8996575 [details]
Bug 1478879 - Define Range/Enum in terms of Iterator/ModIterator.

https://reviewboard.mozilla.org/r/260676/#review267784
Attachment #8996575 - Flags: review?(luke) → review+
Comment on attachment 8996576 [details]
Bug 1478879 - Remove Range/Enum use in testHashTable.cpp.

https://reviewboard.mozilla.org/r/260678/#review267786
Attachment #8996576 - Flags: review?(luke) → review+
Comment on attachment 8996580 [details]
Bug 1478879 - Remove Range/Enum use in devtools/.

https://reviewboard.mozilla.org/r/260686/#review267788

(stealing)
Attachment #8996580 - Flags: review+
Comment on attachment 8996580 [details]
Bug 1478879 - Remove Range/Enum use in devtools/.

https://reviewboard.mozilla.org/r/260686/#review267790
Attachment #8996580 - Flags: review?(sphink) → review+
Pushed by nnethercote@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/591d08c5c22b
Remove zero-arg constructor for Range. r=luke
https://hg.mozilla.org/integration/mozilla-inbound/rev/1e45ce266b66
Introduce Iterator and ModIterator in HashTable.h. r=luke
https://hg.mozilla.org/integration/mozilla-inbound/rev/2c3b5f4eda62
Define Range/Enum in terms of Iterator/ModIterator. r=luke
https://hg.mozilla.org/integration/mozilla-inbound/rev/3bd2221b034d
Remove Range/Enum use in testHashTable.cpp. r=luke
https://hg.mozilla.org/integration/mozilla-inbound/rev/41aeecb74b97
Remove Range/Enum use in DMD. r=mccr8
https://hg.mozilla.org/integration/mozilla-inbound/rev/2f7dbe4598b9
Remove Range/Enum use in Bench.cpp. r=froydnj
https://hg.mozilla.org/integration/mozilla-inbound/rev/b0b47dcc5194
Remove Range/Enum use in dom/. r=mccr8
https://hg.mozilla.org/integration/mozilla-inbound/rev/fd4f3d39873c
Remove Range/Enum use in devtools/. r=sfink
https://hg.mozilla.org/integration/mozilla-inbound/rev/3c7c754ce8fd
Remove Range/Enum use in XPConnect. r=mccr8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: