SortedList<E>.fromPresortedList constructor

const SortedList<E>.fromPresortedList({
  1. required List<E> items,
  2. int compare(
    1. E a,
    2. E b
    )?,
})

creates a SortedList from a pre-sorted list of items

This requires that the provided items are sorted according to the compare function, otherwise the sort order of the list will not be maintained

Implementation

const SortedList.fromPresortedList({
  required List<E> items,
  int Function(E a, E b)? compare,
})  : _items = items,
      _compare = compare;