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

Unified Diff: sdk/lib/core/set.dart

Issue 11414069: Make mappedBy lazy. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Remove CollectionUtils.mappedBy in Swarm. Created 8 years, 1 month 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/core/set.dart
diff --git a/sdk/lib/core/set.dart b/sdk/lib/core/set.dart
index 0bcdbb1cd183987b656cd37fa3680d3afd68e4dc..990348c458783d9bdb7f8f94e61cc73a884ffc5e 100644
--- a/sdk/lib/core/set.dart
+++ b/sdk/lib/core/set.dart
@@ -77,7 +77,7 @@ abstract class HashSet<E> extends Set<E> {
}
-class _HashSetImpl<E> implements HashSet<E> {
+class _HashSetImpl<E> extends Iterable<E> implements HashSet<E> {
_HashSetImpl() {
_backingMap = new _HashMapImpl<E, E>();
@@ -145,37 +145,6 @@ class _HashSetImpl<E> implements HashSet<E> {
});
}
- Set mappedBy(f(E element)) {
- Set result = new Set();
- _backingMap.forEach((E key, E value) {
- result.add(f(key));
- });
- return result;
- }
-
- Dynamic reduce(Dynamic initialValue,
- Dynamic combine(Dynamic previousValue, E element)) {
- return Collections.reduce(this, initialValue, combine);
- }
-
- Set<E> where(bool f(E element)) {
- Set<E> result = new Set<E>();
- _backingMap.forEach((E key, E value) {
- if (f(key)) result.add(key);
- });
- return result;
- }
-
- bool every(bool f(E element)) {
- Collection<E> keys = _backingMap.keys;
- return keys.every(f);
- }
-
- bool some(bool f(E element)) {
- Collection<E> keys = _backingMap.keys;
- return keys.some(f);
- }
-
bool get isEmpty {
return _backingMap.isEmpty;
}
@@ -190,14 +159,6 @@ class _HashSetImpl<E> implements HashSet<E> {
return Collections.collectionToString(this);
}
- List<E> toList() {
- return new List<E>.from(this);
- }
-
- Set<E> toSet() {
- return new Set<E>.from(this);
- }
-
// The map backing this set. The associations in this map are all
// of the form element -> element. If a value is not in the map,
// then it is not in the set.

Powered by Google App Engine
This is Rietveld 408576698