Skip to content

Commit be5986b

Browse files
author
Andy
authored
Remove unused function (microsoft#25138)
* Remove unused function * Update API (microsoft#24966)
1 parent 22d33d2 commit be5986b

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

src/compiler/core.ts

-17
Original file line numberDiff line numberDiff line change
@@ -1029,23 +1029,6 @@ namespace ts {
10291029
return array.slice().sort(comparer);
10301030
}
10311031

1032-
export function best<T>(iter: Iterator<T>, isBetter: (a: T, b: T) => boolean): T | undefined {
1033-
const x = iter.next();
1034-
if (x.done) {
1035-
return undefined;
1036-
}
1037-
let best = x.value;
1038-
while (true) {
1039-
const { value, done } = iter.next();
1040-
if (done) {
1041-
return best;
1042-
}
1043-
if (isBetter(value, best)) {
1044-
best = value;
1045-
}
1046-
}
1047-
}
1048-
10491032
export function arrayIterator<T>(array: ReadonlyArray<T>): Iterator<T> {
10501033
let i = 0;
10511034
return { next: () => {

tests/baselines/reference/api/tsserverlibrary.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ declare namespace ts {
225225
* Returns a new sorted array.
226226
*/
227227
function sort<T>(array: ReadonlyArray<T>, comparer: Comparer<T>): T[];
228-
function best<T>(iter: Iterator<T>, isBetter: (a: T, b: T) => boolean): T | undefined;
229228
function arrayIterator<T>(array: ReadonlyArray<T>): Iterator<T>;
230229
/**
231230
* Stable sort of an array. Elements equal to each other maintain their relative position in the array.

0 commit comments

Comments
 (0)