Skip to content

Commit ce25dc9

Browse files
author
Andy
authored
reduceRight is never used (microsoft#19605)
1 parent 98e9a56 commit ce25dc9

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

src/compiler/core.ts

-26
Original file line numberDiff line numberDiff line change
@@ -985,32 +985,6 @@ namespace ts {
985985
return initial;
986986
}
987987

988-
export function reduceRight<T, U>(array: ReadonlyArray<T>, f: (memo: U, value: T, i: number) => U, initial: U, start?: number, count?: number): U;
989-
export function reduceRight<T>(array: ReadonlyArray<T>, f: (memo: T, value: T, i: number) => T): T;
990-
export function reduceRight<T>(array: T[], f: (memo: T, value: T, i: number) => T, initial?: T, start?: number, count?: number): T {
991-
if (array) {
992-
const size = array.length;
993-
if (size > 0) {
994-
let pos = start === undefined || start > size - 1 ? size - 1 : start;
995-
const end = count === undefined || pos - count < 0 ? 0 : pos - count;
996-
let result: T;
997-
if (arguments.length <= 2) {
998-
result = array[pos];
999-
pos--;
1000-
}
1001-
else {
1002-
result = initial;
1003-
}
1004-
while (pos >= end) {
1005-
result = f(result, array[pos], pos);
1006-
pos--;
1007-
}
1008-
return result;
1009-
}
1010-
}
1011-
return initial;
1012-
}
1013-
1014988
const hasOwnProperty = Object.prototype.hasOwnProperty;
1015989

1016990
/**

0 commit comments

Comments
 (0)