mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-08 02:46:15 -05:00
Updated comments
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user