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

Unified Diff: sdk/lib/html/html_common/filtered_element_list.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 | « sdk/lib/html/dartium/html_dartium.dart ('k') | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/html_common/filtered_element_list.dart
diff --git a/sdk/lib/html/html_common/filtered_element_list.dart b/sdk/lib/html/html_common/filtered_element_list.dart
index 357ff5faa2f38a6a72eb0e9adab512fd9e336343..43d004deaa98f71e9a55317741eee49a187bf12e 100644
--- a/sdk/lib/html/html_common/filtered_element_list.dart
+++ b/sdk/lib/html/html_common/filtered_element_list.dart
@@ -145,6 +145,12 @@ class FilteredElementList implements List {
dynamic combine(dynamic previousValue, Element element)) {
return IterableMixinWorkaround.reduce(this, initialValue, combine);
}
+
+ dynamic fold(dynamic initialValue,
+ dynamic combine(dynamic previousValue, Element element)) {
+ return IterableMixinWorkaround.fold(this, initialValue, combine);
+ }
+
bool every(bool f(Element element)) => _filtered.every(f);
bool any(bool f(Element element)) => _filtered.any(f);
List<Element> toList({ bool growable: true }) =>
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698