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

Unified Diff: sdk/lib/core/list.dart

Issue 134893003: Add internal operation that converts a growable list to a fixed list. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make top-level patch file native. Add comment. Created 6 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:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/core/list.dart
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index 578b4c631972aee7d3165b0715a7e9a6ad7a2ded..0b55b8ec0384ad67df417af79f14fc0b5257cab6 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -96,12 +96,7 @@ abstract class List<E> implements Iterable<E>, EfficientLength {
list.add(e);
}
if (growable) return list;
- int length = list.length;
- List<E> fixedList = new List<E>(length);
- for (int i = 0; i < length; i++) {
- fixedList[i] = list[i];
- }
- return fixedList;
+ return makeListFixedLength(list);
}
/**

Powered by Google App Engine
This is Rietveld 408576698