compareTo method

int compareTo (SourceSpan other)
override

Compares two spans.

other must have the same source URL as this. This orders spans by start then length.

Implementation

int compareTo(SourceSpan other) {
  var result = start.compareTo(other.start);
  return result == 0 ? end.compareTo(other.end) : result;
}