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

Unified Diff: sdk/lib/collection/hash_set.dart

Issue 26681002: Add EfficientLength marker interface to some iterabels. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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/collection/hash_set.dart
diff --git a/sdk/lib/collection/hash_set.dart b/sdk/lib/collection/hash_set.dart
index 12e615e02b140a16e5c5eafbfef4295de217375d..7de1f478ce3dd1a75853ab09237aa5365a61540a 100644
--- a/sdk/lib/collection/hash_set.dart
+++ b/sdk/lib/collection/hash_set.dart
@@ -57,7 +57,8 @@ abstract class _HashSetBase<E> extends IterableBase<E> implements Set<E> {
}
List<E> toList({bool growable: true}) {
- List<E> result = new List<E>()..length = this.length;
+ List<E> result = growable ? (new List<E>()..length = this.length)
floitsch 2013/10/10 13:04:53 do in a separate CL.
+ : new List<E>(this.length);
int i = 0;
for (E element in this) result[i++] = element;
return result;

Powered by Google App Engine
This is Rietveld 408576698