Remove unused function (#25138)

* Remove unused function

* Update API (#24966)
This commit is contained in:
Andy 2018-06-25 08:32:33 -07:00 committed by GitHub
parent 22d33d2292
commit be5986b32d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 18 deletions

View file

@ -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: () => {

View file

@ -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.