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

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

Issue 1999793002: Make Iterable.toList more efficient if the length is known. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Avoid iterator for empty list Created 4 years, 7 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
« no previous file with comments | « sdk/lib/collection/queue.dart ('k') | tests/corelib/corelib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/iterable.dart
diff --git a/sdk/lib/core/iterable.dart b/sdk/lib/core/iterable.dart
index 300b2efcc4cf6a77b23136738fdb9ac988f96427..3e7c1cbd97a3327e64d05cff823dcfb37358c120 100644
--- a/sdk/lib/core/iterable.dart
+++ b/sdk/lib/core/iterable.dart
@@ -336,8 +336,9 @@ abstract class Iterable<E> {
* The elements are in iteration order.
* The list is fixed-length if [growable] is false.
*/
- List<E> toList({ bool growable: true }) =>
- new List<E>.from(this, growable: growable);
+ List<E> toList({bool growable: true}) {
+ return new List<E>.from(this, growable: growable);
+ }
/**
* Creates a [Set] containing the same elements as this iterable.
« no previous file with comments | « sdk/lib/collection/queue.dart ('k') | tests/corelib/corelib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698