Closed Bug 1187137 Opened 9 years ago Closed 8 years ago

Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators

Categories

(Core :: Networking, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

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

References

Details

Attachments

(13 files, 2 obsolete files)

3.98 KB, patch
michal
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
5.41 KB, patch
michal
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
5.46 KB, patch
michal
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
7.56 KB, patch
valentin
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
9.98 KB, patch
valentin
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
12.49 KB, patch
valentin
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
10.22 KB, patch
valentin
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
6.04 KB, patch
valentin
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
11.66 KB, patch
valentin
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
7.47 KB, patch
valentin
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
7.19 KB, patch
valentin
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
7.48 KB, patch
valentin
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
8.88 KB, patch
valentin
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
Because iterators are so much nicer than enumerate functions.

There are 27 occurrences of Enumerate() in these directories.

A note to the assignee: to preserve existing behaviour, you should probably use
nsBaseHashtable::Iterator::Data() rather than nsBaseHashtable::Iterator::UserData(). (The latter should be used when replacing nsBaseHashtable::EnumerateRead()).
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
Attachment #8682841 - Attachment is obsolete: true
Attachment #8682841 - Flags: review?(michal.novotny)
Attachment #8682829 - Flags: review?(michal.novotny) → review+
Attachment #8682849 - Flags: review?(michal.novotny) → review+
Comment on attachment 8682847 [details] [diff] [review]
(part 2) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators

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

Although this seems to be correct, I think it's hard to read. This iteration should be IMO rewritten like this:

iter = mCT.Iter();
while (mNumIdleConns... && !iter.Done()) {
  if (!ent->mIdleConns.Length()) {
    iter.Next();
    continue;
  }

  ...
}
Attachment #8682847 - Flags: review?(michal.novotny)
Attachment #8682847 - Attachment is obsolete: true
Attachment #8688217 - Flags: review?(michal.novotny) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/b886c41710f8179818813068d2f5e9023a94cb29
Bug 1187137 (part 1) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators. r=michal.

https://hg.mozilla.org/integration/mozilla-inbound/rev/6a009f9deeb03ea29a978aab94a2cd4f5a54957e
Bug 1187137 (part 2) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators. r=michal.

https://hg.mozilla.org/integration/mozilla-inbound/rev/09e636bb2c9b63368e977082f3e4650656bdbee9
Bug 1187137 (part 3) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators. r=michal.
Whiteboard: leave-open
Attachment #8682829 - Flags: checkin+
Attachment #8682849 - Flags: checkin+
Attachment #8688217 - Flags: checkin+
Attachment #8713013 - Flags: review?(valentin.gosu) → review+
Attachment #8713014 - Flags: review?(valentin.gosu) → review+
Attachment #8713015 - Flags: review?(valentin.gosu) → review+
Attachment #8713016 - Flags: review?(valentin.gosu) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/76517f16771db1e293f2fc781eda6fba4d20f062
Bug 1187137 (part 4) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators. r=valentin.

https://hg.mozilla.org/integration/mozilla-inbound/rev/f1335a833b756994c85da9548b9053c6d3cbbb85
Bug 1187137 (part 5) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators. r=valentin.

https://hg.mozilla.org/integration/mozilla-inbound/rev/855f567e4f21230ce2fecd3022e5880d9bc87565
Bug 1187137 (part 6) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators. r=valentin.

https://hg.mozilla.org/integration/mozilla-inbound/rev/ac21d6f878e6fdd69ec4140d1b63a94601524abe
Bug 1187137 (part 7) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators. r=valentin.
Attachment #8713013 - Flags: checkin+
Attachment #8713014 - Flags: checkin+
Attachment #8713015 - Flags: checkin+
Attachment #8713016 - Flags: checkin+
Attachment #8713465 - Flags: review?(valentin.gosu) → review+
Attachment #8713470 - Flags: review?(valentin.gosu) → review+
Attachment #8713478 - Flags: review?(valentin.gosu) → review+
Attachment #8713479 - Flags: review?(valentin.gosu) → review+
Attachment #8713481 - Flags: review?(valentin.gosu) → review+
Attachment #8713468 - Flags: review?(valentin.gosu) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/dfef4b5dc032f324af417a93fbf5291c5cb2540e
Bug 1187137 (part 8) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators. r=valentin.

https://hg.mozilla.org/integration/mozilla-inbound/rev/7a1ed2ffd03e963bdf30c1d0c7bdbae8049479eb
Bug 1187137 (part 9) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators. r=valentin.

https://hg.mozilla.org/integration/mozilla-inbound/rev/3c67afd9ada68310b73fbb9c24b33b8888c3c4c1
Bug 1187137 (part 10) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators. r=valentin.

https://hg.mozilla.org/integration/mozilla-inbound/rev/00f18a5aaa83f7b129a798e9d29249c664dab9aa
Bug 1187137 (part 11) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators. r=valentin.

https://hg.mozilla.org/integration/mozilla-inbound/rev/7212563735e403379ad73189536860e72aec342c
Bug 1187137 (part 12) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators. r=valentin.

https://hg.mozilla.org/integration/mozilla-inbound/rev/40fdba3c4cd4516a1ce313d41c40ef9b10484dbe
Bug 1187137 (part 13) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators. r=valentin.
Attachment #8713465 - Flags: checkin+
Attachment #8713468 - Flags: checkin+
Attachment #8713470 - Flags: checkin+
Attachment #8713478 - Flags: checkin+
Attachment #8713479 - Flags: checkin+
Attachment #8713481 - Flags: checkin+
Whiteboard: leave-open
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: