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

Unified Diff: runtime/lib/array.dart

Issue 14071002: Added new version of reduce. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « no previous file | runtime/lib/growable_array.dart » ('j') | runtime/lib/typeddata.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/array.dart
diff --git a/runtime/lib/array.dart b/runtime/lib/array.dart
index 37efab9c7f4d7d7ebba390d179f0a7049ac21d89..ad24af13f97edff2199b61f70d2d0770d2ff7733 100644
--- a/runtime/lib/array.dart
+++ b/runtime/lib/array.dart
@@ -114,8 +114,8 @@ class _ObjectArray<E> implements List<E> {
return IterableMixinWorkaround.mapList(this, f);
}
- reduce(initialValue, combine(previousValue, E element)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
+ reduce(E combine(E value, E element)) {
floitsch 2013/04/10 15:14:07 Return type is E.
Lasse Reichstein Nielsen 2013/04/11 07:54:04 Done.
+ return IterableMixinWorkaround.reduce(this, combine);
}
fold(initialValue, combine(previousValue, E element)) {
@@ -234,10 +234,6 @@ class _ObjectArray<E> implements List<E> {
throw new StateError("More than one element");
}
- E min([int compare(E a, E b)]) => IterableMixinWorkaround.min(this, compare);
-
- E max([int compare(E a, E b)]) => IterableMixinWorkaround.max(this, compare);
-
List<E> toList({ bool growable: true}) {
return new List<E>.from(this, growable: growable);
}
@@ -361,8 +357,8 @@ class _ImmutableArray<E> implements List<E> {
return IterableMixinWorkaround.joinList(this, separator);
}
- reduce(initialValue, combine(previousValue, E element)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
+ reduce(E combine(E value, E element)) {
floitsch 2013/04/10 15:14:07 return type is E.
Lasse Reichstein Nielsen 2013/04/11 07:54:04 Done.
+ return IterableMixinWorkaround.reduce(this, combine);
}
fold(initialValue, combine(previousValue, E element)) {
@@ -486,10 +482,6 @@ class _ImmutableArray<E> implements List<E> {
throw new StateError("More than one element");
}
- E min([int compare(E a, E b)]) => IterableMixinWorkaround.min(this, compare);
-
- E max([int compare(E a, E b)]) => IterableMixinWorkaround.max(this, compare);
-
List<E> toList({ bool growable: true }) {
return new List<E>.from(this, growable: growable);
}
« no previous file with comments | « no previous file | runtime/lib/growable_array.dart » ('j') | runtime/lib/typeddata.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698