Chromium Code Reviews| Index: tools/dom/templates/html/impl/impl_Node.darttemplate |
| diff --git a/tools/dom/templates/html/impl/impl_Node.darttemplate b/tools/dom/templates/html/impl/impl_Node.darttemplate |
| index c312f77c61818217c1cef7636329563e549c827f..307cd0cea96e329577874641d1b269bf174c973d 100644 |
| --- a/tools/dom/templates/html/impl/impl_Node.darttemplate |
| +++ b/tools/dom/templates/html/impl/impl_Node.darttemplate |
| @@ -70,7 +70,13 @@ $endif |
| void addAll(Iterable<Node> iterable) { |
| if (iterable is _ChildNodeListLazy) { |
|
Siggi Cherem (dart-lang)
2013/02/28 19:43:32
is it worth doing this also for other types like L
blois
2013/02/28 20:45:58
The optimized loop requires that it be a browser n
Siggi Cherem (dart-lang)
2013/03/01 00:05:28
I see, thanks! - somehow the [0] below didn't sink
|
| - iterable = new List.from(iterable); |
| + if (iterable._this != _this) { |
|
sra1
2013/03/01 01:17:59
if (!identical(iterable._this, _this))
|
| + // Optimized route for copying between nodes. |
| + for (var i = 0, len = iterable.length; i < len; ++i) { |
| + _this.$dom_appendChild(iterable[0]); |
|
sra1
2013/03/01 01:17:59
iterable.first should be slightly faster.
sra1
2013/03/01 01:28:46
or, better, iterable._this.$dom_firstChild
|
| + } |
| + } |
| + return; |
| } |
| for (Node node in iterable) { |
| _this.$dom_appendChild(node); |