Closed Bug 1582518 Opened 5 years ago Closed 5 years ago

Add an IsEmpty() method to IntervalSet

Categories

(Core :: Audio/Video, enhancement, P3)

enhancement

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().

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.

Restyle include guard + includes to conform to new style rules.

Depends on D46637

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
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: