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

Unified Diff: tools/dom/src/WrappedList.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: tools/dom/src/WrappedList.dart
diff --git a/tools/dom/src/WrappedList.dart b/tools/dom/src/WrappedList.dart
index b49e307cf069e381ea1c746a06f0cb6c2d4d76b5..3f25f384c67b10d7dac320917c7c00eab0481ab6 100644
--- a/tools/dom/src/WrappedList.dart
+++ b/tools/dom/src/WrappedList.dart
@@ -27,8 +27,8 @@ class _WrappedList<E> implements List<E> {
void forEach(void f(E element)) { _list.forEach(f); }
- dynamic reduce(initialValue, combine(previousValue, E element)) =>
- _list.reduce(initialValue, combine);
+ E reduce(E combine(E value, E element)) =>
+ _list.reduce(combine);
dynamic fold(initialValue, combine(previousValue, E element)) =>
_list.fold(initialValue, combine);
@@ -46,10 +46,6 @@ class _WrappedList<E> implements List<E> {
int get length => _list.length;
- E min([int compare(E a, E b)]) => _list.min(compare);
-
- E max([int compare(E a, E b)]) => _list.max(compare);
-
bool get isEmpty => _list.isEmpty;
Iterable<E> take(int n) => _list.take(n);

Powered by Google App Engine
This is Rietveld 408576698