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

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

Issue 13913005: Implement JS version of LinkedHashSet and move the various HashTable implementations to the VM coll… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Map -> set. Created 7 years, 8 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/hash_table.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 04516fc02d7a759ebd3fca97ca8092b70c02cde2..8658733b67f9cc1839c0952741ce94d0f02893dd 100644
--- a/sdk/lib/collection/hash_set.dart
+++ b/sdk/lib/collection/hash_set.dart
@@ -51,6 +51,16 @@ abstract class _HashSetBase<E> extends Collection<E> implements Set<E> {
return result;
}
+ void retainAll(Iterable objectsToRetain) {
+ Set retainSet;
+ if (objectsToRetain is Set) {
+ retainSet = objectsToRetain;
+ } else {
+ retainSet = objectsToRetain.toSet();
+ }
+ retainWhere(retainSet.contains);
+ }
+
String toString() => Collections.collectionToString(this);
}
@@ -79,16 +89,6 @@ class HashSet<E> extends _HashSetBase<E> {
external void removeAll(Iterable objectsToRemove);
- void retainAll(Iterable objectsToRetain) {
- Set retainSet;
- if (objectsToRetain is Set) {
- retainSet = objectsToRetain;
- } else {
- retainSet = objectsToRetain.toSet();
- }
- retainWhere(retainSet.contains);
- }
-
external void removeWhere(bool test(E element));
external void retainWhere(bool test(E element));
« no previous file with comments | « sdk/lib/collection/hash_map.dart ('k') | sdk/lib/collection/hash_table.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698