Skip to content

Commit

Permalink
Copy dom NodeList faster than slice.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed Oct 19, 2015
1 parent e2674bc commit 8cad475
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/dom-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,10 @@
// actual children will be treated as the rendered state once lightChildren
// is populated.
if (!node._lightChildren) {
var c$ = Array.prototype.slice.call(node.childNodes);
var c$ = [];
for (var a=node.firstChild; a = a && a.nextSibling;) {
c$.push(a);
}
for (var i=0, l=c$.length, child; (i<l) && (child=c$[i]); i++) {
child._lightParent = child._lightParent || node;
}
Expand Down

0 comments on commit 8cad475

Please sign in to comment.