Closed
Bug 1582518
Opened 5 years ago
Closed 5 years ago
Add an IsEmpty() method to IntervalSet
Categories
(Core :: Audio/Video, enhancement, P3)
Core
Audio/Video
Tracking
()
RESOLVED
FIXED
mozilla71
Tracking | Status | |
---|---|---|
firefox71 | --- | fixed |
People
(Reporter: bryce, Assigned: bryce)
Details
Attachments
(3 files)
Having a method to check if an IntervalSet
is empty would be a QoL improvement: it's more concise and readable than checking the same thing via Length()
.
Assignee | ||
Comment 1•5 years ago
|
||
This is a quality of life improvement:
- More concise than checking if Length() == 0.
- More readable then if(mySet.Length()) (in my opinion).
- We already have checks that test if IntervalSets are empty by looking at their
length, so there is a use case for this.
Assignee | ||
Comment 2•5 years ago
|
||
Restyle include guard + includes to conform to new style rules.
Depends on D46637
Assignee | ||
Comment 3•5 years ago
|
||
This replaces the instances where Length was being called on an interval set
to determine if it was empty or not empty. IsEmpty makes the intention in these
cases more immediately obvious, and avoids the need to think about ints as
bools in cases like if(!mySet.Length())
.
Depends on D46638
Pushed by bvandyk@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1815141a8caa Add an IsEmpty() method to media's IntervalSet. r=dminor https://hg.mozilla.org/integration/autoland/rev/63b0cd12e313 Restyle some of media's Intervals.h. r=dminor https://hg.mozilla.org/integration/autoland/rev/8cbbfc9b3fb3 Replace IntervalSet.Length usages with IsEmpty where appropriate. r=dminor
Comment 5•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1815141a8caa
https://hg.mozilla.org/mozilla-central/rev/63b0cd12e313
https://hg.mozilla.org/mozilla-central/rev/8cbbfc9b3fb3
Status: NEW → RESOLVED
Closed: 5 years ago
status-firefox71:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in
before you can comment on or make changes to this bug.
Description
•