Skip to content

Commit 8026247

Browse files
🚴 perf(concat): Exploit implicit prototype branching.
1 parent 6d7e7e7 commit 8026247

File tree

17 files changed

+1146
-172
lines changed

17 files changed

+1146
-172
lines changed

src/0-core/_fast/_app3.js

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import assert from 'assert';
2+
3+
export default function _append_small_list(tree, list) {
4+
assert(Number.isInteger(list.length) && list.length >= 0 && list.length <= 4);
5+
// eslint-disable-next-line default-case
6+
switch (list.length) {
7+
case 0:
8+
return tree;
9+
case 1:
10+
return tree.push(list[0]);
11+
case 2:
12+
return tree.push(list[0]).push(list[1]);
13+
case 3:
14+
return tree.push(list[0]).push(list[1]).push(list[2]);
15+
case 4:
16+
return tree.push(list[0]).push(list[1]).push(list[2]).push(list[3]);
17+
}
18+
}

0 commit comments

Comments
 (0)