Skip to content

Commit 440d1b8

Browse files
committed
chore: pre-allocate array
1 parent 21001b7 commit 440d1b8

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
@@ -506,7 +506,7 @@ function pathToAbsolute(pathComponents) {
506506
return pathComponents;
507507
}
508508

509-
var res = [],
509+
var res = new Array(pathComponents.length),
510510
x = 0,
511511
y = 0,
512512
mx = 0,
@@ -524,7 +524,7 @@ function pathToAbsolute(pathComponents) {
524524
}
525525

526526
for (var r, pa, i = start, ii = pathComponents.length; i < ii; i++) {
527-
res.push(r = []);
527+
res[i] = (r = []);
528528
pa = pathComponents[i];
529529
pa0 = pa[0];
530530

0 commit comments

Comments
 (0)