Closed Bug 1186783 Opened 5 years ago Closed 4 years ago

Replace nsBaseHashtable::EnumerateRead() calls in netwerk/ with iterators

Categories

(Core :: Networking, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: njn, Assigned: njn)

References

Details

Attachments

(5 files, 1 obsolete file)

Because iterators are so much nicer than enumerate functions.

There are 11 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: nobody → n.nethercote
Status: NEW → ASSIGNED
Comment on attachment 8682826 [details] [diff] [review]
(part 1) - Replace nsBaseHashtable::EnumerateRead() calls in netwerk/

Review of attachment 8682826 [details] [diff] [review]:
-----------------------------------------------------------------

::: netwerk/streamconv/nsStreamConverterService.cpp
@@ +219,5 @@
>  
>      // Create a corresponding color table for each vertex in the graph.
>      BFSHashTable lBFSTable;
> +    for (auto iter = mAdjacencyList.Iter(); !iter.Done(); iter.Next()) {
> +        const nsACString &aKey = iter.Key();

Please change the variable name (e.g. to key) to not confuse it with argument.
Attachment #8682826 - Flags: review?(michal.novotny) → review+
Attachment #8682826 - Attachment is obsolete: true
Attachment #8689825 - Flags: review?(mcmanus) → review?(valentin.gosu)
Attachment #8689826 - Flags: review?(mcmanus) → review?(valentin.gosu)
Attachment #8689827 - Flags: review?(mcmanus) → review?(valentin.gosu)
Attachment #8689828 - Flags: review?(mcmanus) → review?(valentin.gosu)
Attachment #8689829 - Flags: review?(mcmanus) → review?(valentin.gosu)
I'm fine with these in principal - I'm just stuck with not being able to look at the closely before the holiday and pto wave kicks in.. I'll delegate them to valentin.. thanks!
Attachment #8689826 - Flags: review?(valentin.gosu) → review+
Attachment #8689825 - Flags: review?(valentin.gosu) → review+
Attachment #8689827 - Flags: review?(valentin.gosu) → review+
Attachment #8689829 - Flags: review?(valentin.gosu) → review+
Attachment #8689828 - Flags: review?(valentin.gosu) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/f9045a2712a76bc2d048fcbb462e6395885b0fb1
Bug 1186783 (part 1) - Replace nsBaseHashtable::EnumerateRead() calls in netwerk/ with iterators. r=valentin.

https://hg.mozilla.org/integration/mozilla-inbound/rev/d1f87a9a1795973a6ffa80625b52a725726ea59c
Bug 1186783 (part 2) - Replace nsBaseHashtable::EnumerateRead() calls in netwerk/ with iterators. r=valentin.

https://hg.mozilla.org/integration/mozilla-inbound/rev/788287eae76366afd74bc7a817682bbf2cfd6f8c
Bug 1186783 (part 3) - Replace nsBaseHashtable::EnumerateRead() calls in netwerk/ with iterators. r=valentin.

https://hg.mozilla.org/integration/mozilla-inbound/rev/a53d7747369c6d4fc12fd89e2cdb8c2c2195725b
Bug 1186783 (part 4) - Replace nsBaseHashtable::EnumerateRead() calls in netwerk/ with iterators. r=valentin.

https://hg.mozilla.org/integration/mozilla-inbound/rev/149337c2aa8970ada0aaa78c124d085007db0127
Bug 1186783 (part 5) - Replace nsBaseHashtable::EnumerateRead() calls in netwerk/ with iterators. r=valentin.
You need to log in before you can comment on or make changes to this bug.