SearchComparator<T> extension

on

Methods

binarySearch(List<T> list, T value, {int? start, int? end}) int
Performs a binary search of value on the sorted list. Returns the index of any element that compares equal, or -1 if the value is not found. The result is undefined if the list is not sorted.
binarySearchLower(List<T> list, T value, {int? start, int? end}) int
Performs a binary search of value on the sorted list. Returns the the first suitable insertion index such that list[index - 1] < value <= list[index] (lower bound). The result is undefined if the list is not sorted.
binarySearchUpper(List<T> list, T value, {int? start, int? end}) int
Performs a binary search of value on the sorted list. Returns the the last suitable insertion index such that list[index - 1] <= value< list[index] (upper bound). The result is undefined if the list is not sorted.