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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 12382022: Speeding up Node.nodes.addAll (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 87ba3f1d5cf122a900adb8580cdcff1d7535d571..7b7ad1efecf54df81cccb89b54afff71572cfa34 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -17083,7 +17083,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);
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | tools/dom/templates/html/impl/impl_Node.darttemplate » ('J')

Powered by Google App Engine
This is Rietveld 408576698