Closed
Bug 1259878
Opened 8 years ago
Closed 8 years ago
Animation code uses isSome() when it doesn't need to
Categories
(Core :: DOM: Animation, defect)
Core
DOM: Animation
Tracking
()
RESOLVED
FIXED
mozilla48
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: birtles, Assigned: hiro)
Details
Attachments
(1 file)
In dom/animation we use isSome() when we could just use operator bool to make the code easier to read: For example: https://dxr.mozilla.org/mozilla-central/search?q=path%3Adom%2Fanimation%2F+isSome()&redirect=false&case=true
Assignee | ||
Comment 1•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/42525/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/42525/
Attachment #8735042 -
Flags: review?(bbirtles)
Reporter | ||
Updated•8 years ago
|
Assignee: nobody → hiikezoe
Status: NEW → ASSIGNED
Reporter | ||
Comment 2•8 years ago
|
||
Comment on attachment 8735042 [details] MozReview Request: Bug 1259878 - remove unnecessary isSome(). r?birtles https://reviewboard.mozilla.org/r/42525/#review39045 ::: dom/animation/KeyframeEffect.cpp:1075 (Diff revision 1) > > // Create a JS object with the BaseComputedKeyframe dictionary members. > BaseComputedKeyframe keyframeDict; > keyframeDict.mOffset.SetValue(entry->mOffset); > keyframeDict.mComputedOffset.Construct(entry->mOffset); > - if (entry->mTimingFunction && entry->mTimingFunction->isSome()) { > + if (entry->mTimingFunction && *(entry->mTimingFunction)) { I think the existing code is actually easier to read in this case.
Attachment #8735042 -
Flags: review?(bbirtles)
Assignee | ||
Comment 3•8 years ago
|
||
https://reviewboard.mozilla.org/r/42525/#review39045 > I think the existing code is actually easier to read in this case. Thanks!
Assignee | ||
Comment 4•8 years ago
|
||
Comment on attachment 8735042 [details] MozReview Request: Bug 1259878 - remove unnecessary isSome(). r?birtles Review request updated; see interdiff: https://reviewboard.mozilla.org/r/42525/diff/1-2/
Attachment #8735042 -
Flags: review?(bbirtles)
Reporter | ||
Comment 5•8 years ago
|
||
Comment on attachment 8735042 [details] MozReview Request: Bug 1259878 - remove unnecessary isSome(). r?birtles https://reviewboard.mozilla.org/r/42525/#review39049 Thanks you, looks good!
Attachment #8735042 -
Flags: review?(bbirtles) → review+
Comment 7•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3a90ca63a3f0
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in
before you can comment on or make changes to this bug.
Description
•