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

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

Issue 12544024: Make Set.containsAll accept Iterable. Deprecate Set.isSubsetOf. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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/linked_hash_set.dart
diff --git a/sdk/lib/collection/linked_hash_set.dart b/sdk/lib/collection/linked_hash_set.dart
index 829e801459b558569f7049041addccbffd79c32e..8a4d566130ce6b821fdda7af8dc53518ac83a215 100644
--- a/sdk/lib/collection/linked_hash_set.dart
+++ b/sdk/lib/collection/linked_hash_set.dart
@@ -128,12 +128,19 @@ class LinkedHashSet<E> extends Collection<E> implements Set<E> {
}
// Set.
- bool isSubsetOf(Set<E> other) {
- return IterableMixinWorkaround.isSubsetOfSet(this, other);
+ bool isSubsetOf(Collection<E> other) {
+ // Deprecated, and using old signature.
+ Set otherSet;
+ if (other is Set) {
+ otherSet = other;
+ } else {
+ otherSet = other.toSet();
+ }
+ return IterableMixinWorkaround.setContainsAll(otherSet, this);
}
- bool containsAll(Set<E> other) {
- return IterableMixinWorkaround.isSubsetOfSet(other, this);
+ bool containsAll(Iterable<E> other) {
+ return IterableMixinWorkaround.setContainsAll(this, other);
}
Set<E> intersection(Set<E> other) {

Powered by Google App Engine
This is Rietveld 408576698