Replace nsBaseHashtable::Enumerate() calls in hal/ with iterators

RESOLVED FIXED in Firefox 44

Status

()

Core
Hardware Abstraction Layer (HAL)
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

unspecified
mozilla44
Points:
---

Firefox Tracking Flags

(firefox44 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
Because iterators are so much nicer than enumerate functions.

There is one occurrence of Enumerate() in this directory.

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 8676021 [details] [diff] [review]
Replace nsBaseHashtable::Enumerate() calls in hal/ with iterators
Attachment #8676021 - Flags: review?(dhylands)
(Assignee)

Updated

3 years ago
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
Comment on attachment 8676021 [details] [diff] [review]
Replace nsBaseHashtable::Enumerate() calls in hal/ with iterators

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

lgtm

::: hal/HalWakeLock.cpp
@@ +133,5 @@
> +          NotifyWakeLockChange(WakeLockInfoFromLockCount(iter.Key(),
> +                                                         totalCount));
> +        }
> +
> +        if (totalCount.numLocks == 0) {

Yes! Much easier to read that !totalCount.numLocks
Attachment #8676021 - Flags: review?(dhylands) → review+
(Assignee)

Comment 3

3 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/7f2acbbadd117438960fa1176ef5c067571372a3
Bug 1187142 - Replace nsBaseHashtable::Enumerate() calls in hal/ with iterators. r=dhylands.
https://hg.mozilla.org/mozilla-central/rev/7f2acbbadd11
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox44: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.