Closed
Bug 1127084
Opened 9 years ago
Closed 9 years ago
Remove __iterator__ from ContentPrefStore
Categories
(Toolkit :: General, defect)
Toolkit
General
Tracking
()
RESOLVED
FIXED
mozilla39
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: evilpie, Unassigned)
References
Details
Attachments
(2 files, 1 obsolete file)
18.12 KB,
patch
|
Details | Diff | Splinter Review | |
18.09 KB,
patch
|
mak
:
review+
|
Details | Diff | Splinter Review |
Not sure if this patch works/applies, hopefully somebody can pick this up.
Reporter | ||
Updated•9 years ago
|
Comment 1•9 years ago
|
||
Passed the try run with minor change :) https://treeherder.mozilla.org/#/jobs?repo=try&revision=5872dfe3dbe6
Attachment #8563611 -
Flags: review?(mak77)
Comment 2•9 years ago
|
||
Comment on attachment 8563611 [details] [diff] [review] Remove __iterator__ from ContentPrefStore. Review of attachment 8563611 [details] [diff] [review]: ----------------------------------------------------------------- It looks good overall, but there are still a couple things to fix. it's very very close to be ready. ::: toolkit/components/contentprefs/ContentPrefStore.jsm @@ +41,5 @@ > }, > > get: function CPS_get(group, name) { > if (group) { > + if (this._groups.has(group)) These 2 ifs can now be merged @@ +52,5 @@ > if (group) { > + if (this._groups.has(group)) { > + this._groups.get(group).delete(name); > + if (this._groups.size == 0) > + this._groups.delete(group); This looks wrong, it should be: if (this._groups.get(group).size == 0) @@ +80,3 @@ > }, > > + [Symbol.iterator]: function* () { nit: * [Symbol.iterator]() { @@ +89,5 @@ > yield [null, name, val]; > } > }, > > + match: function* CPS_match(group, name, includeSubdomains) { nit: while touching this: * match(group, name, includeSubdomains) { @@ +96,5 @@ > yield [sgroup, this.get(sgroup, name)]; > } > }, > > + matchGroups: function* CPS_matchGroups(group, includeSubdomains) { nit: while touching this: * matchGroups(group, includeSubdomains) { @@ +104,1 @@ > if (sgroup) { this looks different. Before it was iterating "this", that means it was getting [group, name, val] or (null, name, val) tuples, now you are iterating this._groups, that gives you [ group, Map() ] This code is confusing and lacks comments, to say the minimum. It might work regardless, indeed iterating "this" may return duplicates and doesn't look like anything is expecting them. Though if you keep iterating _groups, you need to fix for (let [sgroup, ]) and remove the if (sgroup) check. Please verify if what I said sounds right to you.
Attachment #8563611 -
Flags: review?(mak77) → feedback+
Comment 3•9 years ago
|
||
Thank you for reviewing! Fixed commented lines. (In reply to Marco Bonardo [::mak] (needinfo? me) from comment #2) > @@ +104,1 @@ > > if (sgroup) { > > this looks different. > Before it was iterating "this", that means it was getting [group, name, val] > or (null, name, val) tuples, > now you are iterating this._groups, that gives you [ group, Map() ] > > This code is confusing and lacks comments, to say the minimum. It might work > regardless, indeed iterating "this" may return duplicates and doesn't look > like anything is expecting them. > Though if you keep iterating _groups, you need to fix for (let [sgroup, ]) > and remove the if (sgroup) check. > > Please verify if what I said sounds right to you. Reverted the change to iterate over `this` (of course with for-of), to keep same behavior. Green on try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=60e517370b58
Attachment #8563611 -
Attachment is obsolete: true
Attachment #8564580 -
Flags: review?(mak77)
Comment 4•9 years ago
|
||
Comment on attachment 8564580 [details] [diff] [review] Remove __iterator__ from ContentPrefStore. Review of attachment 8564580 [details] [diff] [review]: ----------------------------------------------------------------- LGTM! please remember to add the review tag to the commit message before setting the checkin-needed keyword.
Attachment #8564580 -
Flags: review?(mak77) → review+
Comment 5•9 years ago
|
||
Thank you! :D https://hg.mozilla.org/integration/mozilla-inbound/rev/31d67d0ed3cb
https://hg.mozilla.org/mozilla-central/rev/31d67d0ed3cb
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in
before you can comment on or make changes to this bug.
Description
•