Skip to content

Commit 62c67db

Browse files
committed
Avoid using Array.prototype.push
This should speed it up. I might do a proper benchmark (once the core libraries are all updated).
1 parent 22369a5 commit 62c67db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Data/Array.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ exports.fromFoldableImpl = (function () {
4343

4444
function listToArray (list) {
4545
var result = [];
46+
var count = 0;
4647
while (list !== emptyList) {
47-
result.push(list.head);
48+
result[count++] = list.head;
4849
list = list.tail;
4950
}
5051
return result;

0 commit comments

Comments
 (0)