Skip to content

Commit 865a8f2

Browse files
committed
perf: one more quick improvement
1 parent 62d5302 commit 865a8f2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/types/array/methods/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,9 @@ const methods = {
374374
if (val != null && utils.hasUserDefinedProperty(val, '$each')) {
375375
atomics.$push = val;
376376
} else {
377-
if (val.length < 10000) {
377+
if (val.length === 1) {
378+
atomics.$push.$each.push(val);
379+
} else if (val.length < 10000) {
378380
atomics.$push.$each.push(...val);
379381
} else {
380382
for (const v of val) {

0 commit comments

Comments
 (0)