Closed Bug 1182960 Opened 9 years ago Closed 9 years ago

Use nsTHashTable::Iterator in toolkit/

Categories

(Toolkit :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

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

References

Details

Attachments

(2 files)

Because iterators are so much nicer than enumerate functions.

There are ten occurrences of EnumerateEntries() in toolkit/ to be dealt with.
> There are ten occurrences of EnumerateEntries() in toolkit/ to be dealt with.

Correction: there are only eight occurrences. There are two false positive matches when you grep for EnumerateEntries() because there's a local function with that name which, ironically enough, is passed as an argument to an nsBaseHashtable::Enumerate() call.
Attachment #8633477 - Flags: review?(dao) → review?(mak77)
Attachment #8633476 - Flags: review?(dao) → review?(mak77)
Comment on attachment 8633477 [details] [diff] [review]
(part 2) - Use nsTHashtable::Iterator in toolkit/components/places/

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

::: toolkit/components/places/nsFaviconService.cpp
@@ +157,5 @@
>    }
>  
>    PRTime now = PR_Now();
> +  for (auto iter = mUnassociatedIcons.Iter(); !iter.Done(); iter.Next()) {
> +    if (now - iter.Get()->created >= UNASSOCIATED_ICON_EXPIRY_INTERVAL) {

please factor out iter.Get() for readability and showing an explicit type
Attachment #8633477 - Flags: review?(mak77) → review+
Comment on attachment 8633476 [details] [diff] [review]
(part 1) - Use nsTHashtable::Iterator in toolkit/components/telemetry/

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

LGTM
Attachment #8633476 - Flags: review?(mak77) → review+
https://hg.mozilla.org/mozilla-central/rev/774c08a56c10
https://hg.mozilla.org/mozilla-central/rev/a32e92330e99
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: