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

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

Issue 485043002: Optimize List.toList/.sublist and List.from on lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Avoid calling _GrowableList.withData with empty list. Created 6 years, 4 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 0b55b8ec0384ad67df417af79f14fc0b5257cab6..997b2c3f31ad09afcfa93a96a6975b1857ae5cfc 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -90,14 +90,7 @@ abstract class List<E> implements Iterable<E>, EfficientLength {
* This constructor returns a growable list if [growable] is true;
* otherwise, it returns a fixed-length list.
*/
- factory List.from(Iterable other, { bool growable: true }) {
- List<E> list = new List<E>();
- for (E e in other) {
- list.add(e);
- }
- if (growable) return list;
- return makeListFixedLength(list);
- }
+ external factory List.from(Iterable other, { bool growable: true });
/**
* Generates a list of values.

Powered by Google App Engine
This is Rietveld 408576698