mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
Remove type assertion in sum function (#22670)
This commit is contained in:
parent
c48662c891
commit
76fefddcaa
@ -920,8 +920,7 @@ namespace ts {
|
||||
export function sum<T extends Record<K, number>, K extends string>(array: ReadonlyArray<T>, prop: K): number {
|
||||
let result = 0;
|
||||
for (const v of array) {
|
||||
// TODO: Remove the following type assertion once the fix for #17069 is merged
|
||||
result += v[prop] as number;
|
||||
result += v[prop];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user