Updated comments

This commit is contained in:
Ron Buckton
2017-10-29 12:40:40 -07:00
parent e6cdd6334b
commit fcb8296a05

View File

@@ -992,11 +992,15 @@ namespace ts {
}
/**
* Performs a binary search, finding the index at which 'value' occurs in 'array'.
* Performs a binary search, finding the index at which `value` occurs in `array`.
* If no such index is found, returns the 2's-complement of first index at which
* number[index] exceeds number.
* `array[index]` exceeds `value`.
* @param array A sorted array whose first element must be no larger than number
* @param number The value to be searched for in the array.
* @param value The value to be searched for in the array.
* @param keySelector A callback used to select the search key from `value` and each element of
* `array`.
* @param keyComparer A callback used to compare two keys in a sorted array.
* @param offset An offset into `array` at which to start the search.
*/
export function binarySearch<T, U>(array: ReadonlyArray<T>, value: T, keySelector: (v: T) => U, keyComparer: Comparer<U>, offset?: number): number {
if (!array || array.length === 0) {