Commit 2c535a95 by Leon Sorokin Committed by GitHub

Data: use pre-defined output array length in vectorToArray() (#29516)

parent aa70a383
import { Vector } from '../types/vector';
export function vectorToArray<T>(v: Vector<T>): T[] {
const arr: T[] = [];
const arr: T[] = Array(v.length);
for (let i = 0; i < v.length; i++) {
arr[i] = v.get(i);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment