Skip to content

Commit 8cad475

Browse files
author
Steven Orvell
committed
Copy dom NodeList faster than slice.
1 parent e2674bc commit 8cad475

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib/dom-api.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,10 @@
926926
// actual children will be treated as the rendered state once lightChildren
927927
// is populated.
928928
if (!node._lightChildren) {
929-
var c$ = Array.prototype.slice.call(node.childNodes);
929+
var c$ = [];
930+
for (var a=node.firstChild; a = a && a.nextSibling;) {
931+
c$.push(a);
932+
}
930933
for (var i=0, l=c$.length, child; (i<l) && (child=c$[i]); i++) {
931934
child._lightParent = child._lightParent || node;
932935
}

0 commit comments

Comments
 (0)