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

Unified Diff: corelib/src/implementation/hash_map_set.dart

Issue 10827293: Reapply 'Add reduce to Collection.' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add fixes. Created 8 years, 4 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: corelib/src/implementation/hash_map_set.dart
diff --git a/corelib/src/implementation/hash_map_set.dart b/corelib/src/implementation/hash_map_set.dart
index c538951fff31beb62674103b8c7517339c0c8ded..c3d45790e5f4af5bb17c6c62442fd8e765b925c0 100644
--- a/corelib/src/implementation/hash_map_set.dart
+++ b/corelib/src/implementation/hash_map_set.dart
@@ -350,6 +350,11 @@ class HashSetImplementation<E extends Hashable> implements HashSet<E> {
return result;
}
+ Dynamic reduce(Dynamic initialValue,
+ Dynamic combine(Dynamic previousValue, E element)) {
+ return Collections.reduce(this, initialValue, combine);
+ }
+
Set<E> filter(bool f(E element)) {
Set<E> result = new Set<E>();
_backingMap.forEach(void _(E key, E value) {

Powered by Google App Engine
This is Rietveld 408576698