Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Issue 12382022: Speeding up Node.nodes.addAll (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index b485c4478ceb9e1c6db17acc25d10bf921488c70..8002b841c78d274dadb3d72952578af847012e5e 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -18592,7 +18592,13 @@ class _ChildNodeListLazy implements List {
void addAll(Iterable<Node> iterable) {
if (iterable is _ChildNodeListLazy) {
- iterable = new List.from(iterable);
+ if (iterable._this != _this) {
+ // Optimized route for copying between nodes.
+ for (var i = 0, len = iterable.length; i < len; ++i) {
+ _this.$dom_appendChild(iterable[0]);
+ }
+ }
+ return;
}
for (Node node in iterable) {
_this.$dom_appendChild(node);

Powered by Google App Engine
This is Rietveld 408576698