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

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: Address comments. 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 | « runtime/lib/growable_array.dart ('k') | samples/openglui/src/openglui_canvas_tests.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/typeddata.dart
diff --git a/runtime/lib/typeddata.dart b/runtime/lib/typeddata.dart
index c4c2d32bb93879217977c741dafe453428e7df7b..244948cd21be5b6c8a4921b308e59283a95c8beb 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);
+ }
+
Iterable where(bool f(int element)) {
return IterableMixinWorkaround.where(this, f);
}
« no previous file with comments | « runtime/lib/growable_array.dart ('k') | samples/openglui/src/openglui_canvas_tests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698