sortByCompare<K> method

void sortByCompare<K>(
  1. K keyOf(
    1. E element
    ),
  2. int compare(
    1. K a,
    2. K b
    ), [
  3. int start = 0,
  4. int? end,
])

Sorts elements by the compare of their keyOf property.

Sorts elements from start to end, defaulting to the entire list.

Implementation

void sortByCompare<K>(
    K Function(E element) keyOf, int Function(K a, K b) compare,
    [int start = 0, int? end]) {
  quickSortBy(this, keyOf, compare, start, end);
}