Skip to content

Commit aab68ea

Browse files
refactor: reorder template tag check to avoid expensive instanceof first
Co-authored-by: Ryan Christian <33403762+rschristian@users.noreply.github.com>
1 parent 3cde9c2 commit aab68ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/diff/children.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ export function diffChildren(
5454
refQueue
5555
) {
5656
if (
57-
parentDom instanceof DocumentFragment &&
5857
newParentVNode.type === 'template' &&
59-
excessDomChildren?.length === 0
58+
excessDomChildren?.length === 0 &&
59+
parentDom instanceof DocumentFragment
6060
) {
61-
excessDomChildren = Array.from(parentDom.childNodes);
61+
excessDomChildren = slice.call(parentDom.childNodes);
6262
}
6363
let i,
6464
/** @type {VNode} */

0 commit comments

Comments
 (0)