Closed
Bug 1186787
Opened 9 years ago
Closed 9 years ago
Replace nsBaseHashtable::EnumerateRead() calls in chrome/ with iterators
Categories
(Core :: General, defect)
Core
General
Tracking
()
RESOLVED
FIXED
mozilla45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
Details
Attachments
(2 files)
4.21 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
2.42 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
Because iterators are so much nicer than enumerate functions. There are two occurrences of EnumerateRead() in this directory. A note to the assignee: to preserve existing behaviour, you should probably use nsBaseHashtable::Iterator::UserData() rather than nsBaseHashtable::Iterator::Data(). (The latter should be used when replacing nsBaseHashtable::Enumerate()).
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8688252 -
Flags: review?(nfroyd)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•9 years ago
|
||
Attachment #8688253 -
Flags: review?(nfroyd)
Updated•9 years ago
|
Attachment #8688252 -
Flags: review?(nfroyd) → review+
Comment 3•9 years ago
|
||
Comment on attachment 8688253 [details] [diff] [review] (part 2) - Replace nsBaseHashtable::EnumerateRead() calls in chrome/ with iterators Review of attachment 8688253 [details] [diff] [review]: ----------------------------------------------------------------- I wonder how much better things would be if we did: OverrideMapping* om = $.AppendElement(); SerializeURI(..., om->originalURI); SerializeURI(..., om->overrideURI); Not asking you to do this, just wondering about the micro-optimization. Alternatively, for micro-optimizations, you could: OverrideMapping* omptr = $.AppendElements(mOverrideTable.Count()); for (...) { SerializeURI(..., omptr->...); omptr++; } Maybe all these micro-optimizations should be a separate bug. :)
Attachment #8688253 -
Flags: review?(nfroyd) → review+
Assignee | ||
Comment 4•9 years ago
|
||
> Maybe all these micro-optimizations should be a separate bug. :)
Feel free to file one :) Measurements showing this code is hot would be a useful accompaniment; I suspect it's not but I've been wrong before...
Assignee | ||
Comment 5•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/401949c4008ed49464a7fd13781bee79b432a0b4 Bug 1186787 (part 1) - Replace nsBaseHashtable::EnumerateRead() calls in chrome/ with iterators. r=froydnj. https://hg.mozilla.org/integration/mozilla-inbound/rev/4e0a66f7b693d055ef52c5b17d55cb117d6296b0 Bug 1186787 (part 2) - Replace nsBaseHashtable::EnumerateRead() calls in chrome/ with iterators. r=froydnj.
Comment 6•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/401949c4008e https://hg.mozilla.org/mozilla-central/rev/4e0a66f7b693
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in
before you can comment on or make changes to this bug.
Description
•