operator == method

  1. @override
bool operator ==(
  1. Object obj
)
override

Are two IntervalSets equal? Because all intervals are sorted and disjoint, equals is a simple linear walk over both lists to make sure they are the same. Interval.equals() is used by the List.equals() method to check the ranges.

Implementation

@override
bool operator ==(Object obj) {
  if (obj is! IntervalSet) {
    return false;
  }
  return ListEquality().equals(intervals, obj.intervals);
}