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

Unified Diff: runtime/lib/byte_array.dart

Issue 10827293: Reapply 'Add reduce to Collection.' (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add fixes. Created 8 years, 4 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/byte_array.dart
diff --git a/runtime/lib/byte_array.dart b/runtime/lib/byte_array.dart
index 9db082aa2a5c9d628f169288fde670bddec647f2..60d0ecf2e661f92dad9e9523165e101be68b9503 100644
--- a/runtime/lib/byte_array.dart
+++ b/runtime/lib/byte_array.dart
@@ -812,6 +812,11 @@ abstract class _ByteArrayBase {
f);
}
+ Dynamic reduce(Dynamic initialValue,
+ Dynamic combine(Dynamic initialValue, element)) {
+ return Collections.reduce(this, initialValue, combine);
+ }
+
Collection filter(bool f(element)) {
return Collections.filter(this, new GrowableObjectArray(), f);
}
@@ -2286,6 +2291,11 @@ class _ByteArrayViewBase {
f);
}
+ Dynamic reduce(Dynamic initialValue,
+ Dynamic combine(Dynamic initialValue, element)) {
+ return Collections.reduce(this, initialValue, combine);
+ }
+
Collection filter(bool f(element)) {
return Collections.filter(this, new GrowableObjectArray(), f);
}

Powered by Google App Engine
This is Rietveld 408576698