sortedRange method

Bloom<List<E>> sortedRange(
  1. int start,
  2. int end, [
  3. int compare(
    1. E a,
    2. E b
    )?
])

Returns a new unmodifiable list containing a sorted range of elements from this list.

  • start: Inclusive start index of the range to sort.
  • end: Exclusive end index of the range to sort.
  • compare: Optional comparator overriding Comparable.compareTo.

Implementation

Bloom<List<E>> sortedRange(int start, int end,
        [int Function(E a, E b)? compare]) =>
    computed((via) {
      final copy = via(_listBloom).toList();
      col.ListExtensions(copy)
          .sortRange(start, end, compare ?? (a, b) => a.compareTo(b));
      return List<E>.unmodifiable(copy);
    });