Skip to content

Commit 4885f1d

Browse files
authored
Use .push.apply (#5024)
1 parent 6dd0e3e commit 4885f1d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/diff/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import {
1313
SVG_NAMESPACE,
1414
UNDEFINED,
1515
XHTML_NAMESPACE,
16-
MATHML_TOKEN_ELEMENTS
16+
MATHML_TOKEN_ELEMENTS,
17+
EMPTY_ARR
1718
} from '../constants';
1819
import { BaseComponent, getDomSibling } from '../component';
1920
import { Fragment } from '../create-element';
@@ -209,7 +210,7 @@ export function diff(
209210
if (vnode) vnode._parent = newVNode;
210211
});
211212

212-
c._renderCallbacks.push(...c._stateCallbacks);
213+
EMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);
213214
c._stateCallbacks = [];
214215

215216
if (c._renderCallbacks.length) {
@@ -245,7 +246,7 @@ export function diff(
245246

246247
tmp = c.render(c.props, c.state, c.context);
247248

248-
c._renderCallbacks.push(...c._stateCallbacks);
249+
EMPTY_ARR.push.apply(c._renderCallbacks, c._stateCallbacks);
249250
c._stateCallbacks = [];
250251
} else {
251252
do {

0 commit comments

Comments
 (0)