-
-
Notifications
You must be signed in to change notification settings - Fork 184
Expand file tree
/
Copy pathSparseArrayPush.ts
More file actions
11 lines (10 loc) · 462 Bytes
/
SparseArrayPush.ts
File metadata and controls
11 lines (10 loc) · 462 Bytes
1
2
3
4
5
6
7
8
9
10
11
import { __TS__CountVarargs } from "./CountVarargs";
import { __TS__SparseArray } from "./SparseArray";
export function __TS__SparseArrayPush<T>(this: void, sparseArray: __TS__SparseArray<T>, ...args: T[]): void {
const argsLen = __TS__CountVarargs(...args);
const listLen = sparseArray.sparseLength;
for (const i of $range(1, argsLen)) {
sparseArray[listLen + i - 1] = args[i - 1];
}
sparseArray.sparseLength = listLen + argsLen;
}