@@ -65,8 +65,8 @@ int binarySearchBy<E, K>(List<E> sortedList, K Function(E element) keyOf,
6565/// If [compare] is omitted, this defaults to calling [Comparable.compareTo] on
6666/// the objects. In this case, the objects must be [Comparable] .
6767///
68- /// Returns [sortedList.length ] if all the items in [sortedList] compare less
69- /// than [value] .
68+ /// Returns the length of [sortedList] if all the items in [sortedList] compare
69+ /// less than [value] .
7070int lowerBound <E >(List <E > sortedList, E value, {int Function (E , E )? compare}) {
7171 compare ?? = defaultCompare;
7272 return lowerBoundBy <E , E >(sortedList, identity, compare, value);
@@ -76,11 +76,13 @@ int lowerBound<E>(List<E> sortedList, E value, {int Function(E, E)? compare}) {
7676///
7777/// Uses binary search to find the location of [value] .
7878/// This takes on the order of `log(n)` comparisons.
79- /// Elements are compared using the [compare] function of the [keyOf] property of
80- /// the elements.
81- /// If the list isn't sorted according to this order, the result is unpredictable.
79+ /// Elements are compared using the [compare] function of the [keyOf] property
80+ /// of the elements.
81+ /// If the list isn't sorted according to this order, the result is
82+ /// unpredictable.
8283///
83- /// Returns [sortedList.length] if all the items in [sortedList] are before [value] .
84+ /// Returns the length of [sortedList] if all the items in [sortedList] are
85+ /// before [value] .
8486///
8587/// If [start] and [end] are supplied, only that range is searched,
8688/// and only that range need to be sorted.
@@ -231,12 +233,12 @@ void mergeSort<E>(List<E> elements,
231233 var secondLength = end - middle;
232234 // secondLength is always the same as firstLength, or one greater.
233235 var scratchSpace = List <E >.filled (secondLength, elements[start]);
234- E Function (E ) id = identity;
235- _mergeSort (elements, id, compare, middle, end, scratchSpace, 0 );
236+ _mergeSort (elements, identity< E > , compare, middle, end, scratchSpace, 0 );
236237 var firstTarget = end - firstLength;
237- _mergeSort (elements, id, compare, start, middle, elements, firstTarget);
238- _merge (id, compare, elements, firstTarget, end, scratchSpace, 0 , secondLength,
239- elements, start);
238+ _mergeSort (
239+ elements, identity< E > , compare, start, middle, elements, firstTarget);
240+ _merge (identity< E > , compare, elements, firstTarget, end, scratchSpace, 0 ,
241+ secondLength, elements, start);
240242}
241243
242244/// Sort [elements] using a merge-sort algorithm.
@@ -408,7 +410,7 @@ void quickSort<E>(List<E> elements, int Function(E a, E b) compare,
408410 _quickSort <E , E >(elements, identity, compare, Random (), start, end);
409411}
410412
411- /// Sort [elements ] using a quick-sort algorithm.
413+ /// Sort [list ] using a quick-sort algorithm.
412414///
413415/// The elements are compared using [compare] on the value provided by [keyOf]
414416/// on the element.
0 commit comments