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

Unified Diff: runtime/lib/growable_array.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/growable_array.dart
diff --git a/runtime/lib/growable_array.dart b/runtime/lib/growable_array.dart
index bf52c4385baa5834baeebbf9c7134df79a5366e5..753ba1e5a925b32657517505772a91ce5bddca63 100644
--- a/runtime/lib/growable_array.dart
+++ b/runtime/lib/growable_array.dart
@@ -268,6 +268,10 @@ class _GrowableObjectArray<T> implements List<T> {
return IterableMixinWorkaround.reduce(this, initialValue, combine);
}
+ fold(initialValue, combine(previousValue, T element)) {
+ return IterableMixinWorkaround.fold(this, initialValue, combine);
+ }
+
Iterable<T> where(bool f(T element)) {
return IterableMixinWorkaround.where(this, f);
}
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/lib/typeddata.dart » ('j') | sdk/lib/core/iterable.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698