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: Comparator defining the sort order.

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);
      return List<E>.unmodifiable(copy);
    });