Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit e462787

Browse files
mheverychirayuk
authored andcommitted
perf(dom): improve dom cloning speed
1 parent 6df2195 commit e462787

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/core_dom/common.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
part of angular.core.dom_internal;
22

3-
List<dom.Node> cloneElements(elements) => elements.map((el) => el.clone(true)).toList();
3+
List<dom.Node> cloneElements(List<dom.Node> elements) {
4+
int length = elements.length;
5+
var clones = new List<dom.Node>(length);
6+
for(var i=0; i < length; i++) {
7+
clones[i] = elements[i].clone(true);
8+
}
9+
return clones;
10+
}
411

512
class MappingParts {
613
final String attrName;

0 commit comments

Comments
 (0)