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

Unified Diff: sdk/lib/html/html_common/filtered_element_list.dart

Issue 14071002: Added new version of reduce. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed more uses of max, and a few bugs. 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
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 ed8e12dc0234cab431cd995c0ce666898428af76..f915f8208e229b4be2fbb3464e085b5f962c82f1 100644
--- a/sdk/lib/html/html_common/filtered_element_list.dart
+++ b/sdk/lib/html/html_common/filtered_element_list.dart
@@ -141,14 +141,13 @@ class FilteredElementList extends ListBase<Element> {
IterableMixinWorkaround.retainWhere(this, test);
}
- dynamic reduce(dynamic initialValue,
- dynamic combine(dynamic previousValue, Element element)) {
- return _filtered.reduce(initialValue, combine);
+ Element reduce(Element combine(Element value, Element element)) {
+ return _filtered.reduce(combine);
}
dynamic fold(dynamic initialValue,
dynamic combine(dynamic previousValue, Element element)) {
- return IterableMixinWorkaround.fold(this, initialValue, combine);
+ return _filtered.fold(initialValue, combine);
}
bool every(bool f(Element element)) => _filtered.every(f);

Powered by Google App Engine
This is Rietveld 408576698