Skip to content

Commit 4a3c777

Browse files
committed
chore: pre-allocate array
1 parent 9d4b092 commit 4a3c777

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

intersect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ function pathToAbsolute(pathComponents) {
512512
return pathComponents;
513513
}
514514

515-
var res = [],
515+
var res = new Array(pathComponents.length),
516516
x = 0,
517517
y = 0,
518518
mx = 0,
@@ -530,7 +530,7 @@ function pathToAbsolute(pathComponents) {
530530
}
531531

532532
for (var r, pa, i = start, ii = pathComponents.length; i < ii; i++) {
533-
res.push(r = []);
533+
res[i] = (r = []);
534534
pa = pathComponents[i];
535535
pa0 = pa[0];
536536

0 commit comments

Comments
 (0)