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

RESOLVED FIXED in Firefox 47

Status

()

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

unspecified
mozilla47
Points:
---

Firefox Tracking Flags

(firefox47 fixed)

Details

Attachments

(13 attachments, 2 obsolete attachments)

3.98 KB, patch
michal.novotny
: review+
njn
: checkin+
Details | Diff | Splinter Review
5.41 KB, patch
michal.novotny
: review+
njn
: checkin+
Details | Diff | Splinter Review
5.46 KB, patch
michal.novotny
: review+
njn
: checkin+
Details | Diff | Splinter Review
7.56 KB, patch
valentin
: review+
njn
: checkin+
Details | Diff | Splinter Review
9.98 KB, patch
valentin
: review+
njn
: checkin+
Details | Diff | Splinter Review
12.49 KB, patch
valentin
: review+
njn
: checkin+
Details | Diff | Splinter Review
10.22 KB, patch
valentin
: review+
njn
: checkin+
Details | Diff | Splinter Review
6.04 KB, patch
valentin
: review+
njn
: checkin+
Details | Diff | Splinter Review
11.66 KB, patch
valentin
: review+
njn
: checkin+
Details | Diff | Splinter Review
7.47 KB, patch
valentin
: review+
njn
: checkin+
Details | Diff | Splinter Review
7.19 KB, patch
valentin
: review+
njn
: checkin+
Details | Diff | Splinter Review
7.48 KB, patch
valentin
: review+
njn
: checkin+
Details | Diff | Splinter Review
8.88 KB, patch
valentin
: review+
njn
: checkin+
Details | Diff | Splinter Review
(Assignee)

Description

3 years ago
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)

Comment 1

3 years ago
Created attachment 8682829 [details] [diff] [review]
(part 1) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators
Attachment #8682829 - Flags: review?(michal.novotny)
(Assignee)

Updated

3 years ago
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
(Assignee)

Comment 2

3 years ago
Created attachment 8682841 [details] [diff] [review]
(part 2) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators
Attachment #8682841 - Flags: review?(michal.novotny)
(Assignee)

Comment 3

3 years ago
Created attachment 8682847 [details] [diff] [review]
(part 2) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators
Attachment #8682847 - Flags: review?(michal.novotny)
(Assignee)

Updated

3 years ago
Attachment #8682841 - Attachment is obsolete: true
Attachment #8682841 - Flags: review?(michal.novotny)
(Assignee)

Comment 4

3 years ago
Created attachment 8682849 [details] [diff] [review]
(part 3) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators
Attachment #8682849 - 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)
(Assignee)

Comment 6

3 years ago
Created attachment 8688217 [details] [diff] [review]
(part 2) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators

Updated as requested.
Attachment #8688217 - Flags: review?(michal.novotny)
(Assignee)

Updated

3 years ago
Attachment #8682847 - Attachment is obsolete: true
Attachment #8688217 - Flags: review?(michal.novotny) → review+
(Assignee)

Comment 7

3 years ago
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.
(Assignee)

Updated

3 years ago
Whiteboard: leave-open
(Assignee)

Updated

3 years ago
Attachment #8682829 - Flags: checkin+
(Assignee)

Updated

3 years ago
Attachment #8682849 - Flags: checkin+
(Assignee)

Updated

3 years ago
Attachment #8688217 - Flags: checkin+
(Assignee)

Comment 9

3 years ago
Created attachment 8713013 [details] [diff] [review]
(part 4) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators
Attachment #8713013 - Flags: review?(valentin.gosu)
(Assignee)

Comment 10

3 years ago
Created attachment 8713014 [details] [diff] [review]
(part 5) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators
Attachment #8713014 - Flags: review?(valentin.gosu)
(Assignee)

Comment 11

3 years ago
Created attachment 8713015 [details] [diff] [review]
(part 6) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators
Attachment #8713015 - Flags: review?(valentin.gosu)
(Assignee)

Comment 12

3 years ago
Created attachment 8713016 [details] [diff] [review]
(part 7) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators
Attachment #8713016 - Flags: review?(valentin.gosu)
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+
(Assignee)

Comment 13

3 years ago
Created attachment 8713465 [details] [diff] [review]
(part 8) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators
Attachment #8713465 - Flags: review?(valentin.gosu)
(Assignee)

Comment 14

3 years ago
Created attachment 8713468 [details] [diff] [review]
(part 9) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators
Attachment #8713468 - Flags: review?(valentin.gosu)
(Assignee)

Comment 15

3 years ago
Created attachment 8713470 [details] [diff] [review]
(part 10) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators
Attachment #8713470 - Flags: review?(valentin.gosu)
(Assignee)

Comment 16

3 years ago
Created attachment 8713478 [details] [diff] [review]
(part 11) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators
Attachment #8713478 - Flags: review?(valentin.gosu)
(Assignee)

Comment 17

3 years ago
Created attachment 8713479 [details] [diff] [review]
(part 12) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators
Attachment #8713479 - Flags: review?(valentin.gosu)
(Assignee)

Comment 18

3 years ago
Created attachment 8713481 [details] [diff] [review]
(part 13) - Replace nsBaseHashtable::Enumerate() calls in netwerk/protocol/ with iterators
Attachment #8713481 - Flags: review?(valentin.gosu)
(Assignee)

Comment 19

3 years ago
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.
(Assignee)

Updated

3 years ago
Attachment #8713013 - Flags: checkin+
(Assignee)

Updated

3 years ago
Attachment #8713014 - Flags: checkin+
(Assignee)

Updated

3 years ago
Attachment #8713015 - Flags: checkin+
(Assignee)

Updated

3 years ago
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+
(Assignee)

Comment 21

3 years ago
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.
(Assignee)

Updated

3 years ago
Attachment #8713465 - Flags: checkin+
(Assignee)

Updated

3 years ago
Attachment #8713468 - Flags: checkin+
(Assignee)

Updated

3 years ago
Attachment #8713470 - Flags: checkin+
(Assignee)

Updated

3 years ago
Attachment #8713478 - Flags: checkin+
(Assignee)

Updated

3 years ago
Attachment #8713479 - Flags: checkin+
(Assignee)

Updated

3 years ago
Attachment #8713481 - Flags: checkin+
(Assignee)

Updated

3 years ago
Whiteboard: leave-open
You need to log in before you can comment on or make changes to this bug.