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

Unified Diff: runtime/lib/typeddata.dart

Issue 13548002: Add Iterable.fold (and Stream.fold) which replace `reduce`. (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: runtime/lib/typeddata.dart
diff --git a/runtime/lib/typeddata.dart b/runtime/lib/typeddata.dart
index 4375a1c5ce3ea9a8e4e83fadfad5e9aad02b2712..8ea689ae2ee7cf36975f9bc25e9a74a2ff0fd052 100644
--- a/runtime/lib/typeddata.dart
+++ b/runtime/lib/typeddata.dart
@@ -312,6 +312,11 @@ abstract class _TypedListBase {
return IterableMixinWorkaround.reduce(this, initialValue, combine);
}
+ dynamic fold(dynamic initialValue,
+ dynamic combine(dynamic initialValue, element)) {
+ return IterableMixinWorkaround.fold(this, initialValue, combine);
+ }
+
Collection where(bool f(int element)) {
return IterableMixinWorkaround.where(this, f);
}

Powered by Google App Engine
This is Rietveld 408576698