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

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

Issue 288103003: Change Set.toSet to always return a set with the same behavior. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Change .clone() to use .toSet(). Update docs. Created 6 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
Index: sdk/lib/collection/hash_set.dart
diff --git a/sdk/lib/collection/hash_set.dart b/sdk/lib/collection/hash_set.dart
index ff95b4306541a488d0bb5daf90f5df34278f0aa6..026777863d591f5d16a942a47acd96fad1f03f5a 100644
--- a/sdk/lib/collection/hash_set.dart
+++ b/sdk/lib/collection/hash_set.dart
@@ -58,6 +58,8 @@ abstract class _HashSetBase<E> extends IterableBase<E> implements Set<E> {
return result;
}
+ Set<E> cloneEmpty() => _newSet();
+
Set<E> toSet() => _newSet()..addAll(this);
String toString() => IterableMixinWorkaround.toStringIterable(this, '{', '}');

Powered by Google App Engine
This is Rietveld 408576698