lowerBound<E> function
Null safety
Returns the first position in sortedList
that does not compare less than
value
.
If the list isn't sorted according to the compare
function, the result
is unpredictable.
If compare
is omitted, this defaults to calling Comparable.compareTo on
the objects. In this case, the objects must be Comparable.
Returns sortedList.length
if all the items in sortedList
compare less
than value
.
Implementation
int lowerBound<E>(List<E> sortedList, E value, {int Function(E, E)? compare}) {
compare ??= defaultCompare;
return lowerBoundBy<E, E>(sortedList, identity, compare, value);
}