Remove unused function (#25138)
* Remove unused function * Update API (#24966)
This commit is contained in:
parent
22d33d2292
commit
be5986b32d
2 changed files with 0 additions and 18 deletions
|
@ -1029,23 +1029,6 @@ namespace ts {
|
|||
return array.slice().sort(comparer);
|
||||
}
|
||||
|
||||
export function best<T>(iter: Iterator<T>, isBetter: (a: T, b: T) => boolean): T | undefined {
|
||||
const x = iter.next();
|
||||
if (x.done) {
|
||||
return undefined;
|
||||
}
|
||||
let best = x.value;
|
||||
while (true) {
|
||||
const { value, done } = iter.next();
|
||||
if (done) {
|
||||
return best;
|
||||
}
|
||||
if (isBetter(value, best)) {
|
||||
best = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function arrayIterator<T>(array: ReadonlyArray<T>): Iterator<T> {
|
||||
let i = 0;
|
||||
return { next: () => {
|
||||
|
|
|
@ -225,7 +225,6 @@ declare namespace ts {
|
|||
* Returns a new sorted array.
|
||||
*/
|
||||
function sort<T>(array: ReadonlyArray<T>, comparer: Comparer<T>): T[];
|
||||
function best<T>(iter: Iterator<T>, isBetter: (a: T, b: T) => boolean): T | undefined;
|
||||
function arrayIterator<T>(array: ReadonlyArray<T>): Iterator<T>;
|
||||
/**
|
||||
* Stable sort of an array. Elements equal to each other maintain their relative position in the array.
|
||||
|
|
Loading…
Reference in a new issue