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

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

Issue 26481002: Change the toString method of IterableBase/IterableMixin to show some elements. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. 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
« no previous file with comments | « sdk/lib/_collection_dev/to_string.dart ('k') | sdk/lib/collection/iterable.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1ed7a085965c57dd6cbebc72788074b89db4a3f5 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)
+ : new List<E>(this.length);
int i = 0;
for (E element in this) result[i++] = element;
return result;
@@ -65,7 +66,6 @@ abstract class _HashSetBase<E> extends IterableBase<E> implements Set<E> {
Set<E> toSet() => _newSet()..addAll(this);
- // TODO(zarah) Remove this, and let it be inherited by IterableBase
String toString() => IterableMixinWorkaround.toStringIterable(this, '{', '}');
}
« no previous file with comments | « sdk/lib/_collection_dev/to_string.dart ('k') | sdk/lib/collection/iterable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698