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

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

Issue 14246008: Allow Object when doing lookups. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Forgot to upload before committing Created 7 years, 6 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/hash_map.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 e2c797d9c13b27875682859e06bc5b95a8c4ea86..86c69c81ee5f4346fea08f0b42fbfc8bec58300f 100644
--- a/sdk/lib/collection/hash_set.dart
+++ b/sdk/lib/collection/hash_set.dart
@@ -7,8 +7,8 @@ part of dart.collection;
/** Common parts of [HashSet] and [LinkedHashSet] implementations. */
abstract class _HashSetBase<E> extends IterableBase<E> implements Set<E> {
// Set.
- bool containsAll(Iterable<E> other) {
- for (E object in other) {
+ bool containsAll(Iterable<Object> other) {
+ for (Object object in other) {
if (!this.contains(object)) return false;
}
return true;
@@ -17,10 +17,10 @@ abstract class _HashSetBase<E> extends IterableBase<E> implements Set<E> {
/** Create a new Set of the same type as this. */
Set _newSet();
- Set<E> intersection(Set<E> other) {
+ Set<E> intersection(Set<Object> other) {
Set<E> result = _newSet();
if (other.length < this.length) {
- for (E element in other) {
+ for (var element in other) {
if (this.contains(element)) result.add(element);
}
} else {
@@ -95,7 +95,7 @@ class HashSet<E> extends _HashSetBase<E> {
external bool remove(Object object);
- external void removeAll(Iterable objectsToRemove);
+ external void removeAll(Iterable<Object> objectsToRemove);
external void removeWhere(bool test(E element));
« no previous file with comments | « sdk/lib/collection/hash_map.dart ('k') | sdk/lib/collection/iterable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698