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

Unified Diff: runtime/bin/vmstats/bargraph.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 | « runtime/bin/process_patch.dart ('k') | runtime/lib/array.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmstats/bargraph.dart
diff --git a/runtime/bin/vmstats/bargraph.dart b/runtime/bin/vmstats/bargraph.dart
index 3eb4b3d7fae23e45a842405875b21151301fadac..c35325385149e6d8ac3caccb79aeb3c165b8e855 100644
--- a/runtime/bin/vmstats/bargraph.dart
+++ b/runtime/bin/vmstats/bargraph.dart
@@ -220,6 +220,6 @@ class Sample {
Iterator<int> get iterator => _segments.iterator;
int total() {
- return _segments.reduce(0, (int prev, int element) => prev + element);
+ return _segments.fold(0, (int prev, int element) => prev + element);
}
}
« no previous file with comments | « runtime/bin/process_patch.dart ('k') | runtime/lib/array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698