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

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: Created 7 years, 9 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/bin/vmstats/bargraph.dart
diff --git a/runtime/bin/vmstats/bargraph.dart b/runtime/bin/vmstats/bargraph.dart
index 502ff8e0b1528d60845d649225ec77cef844a5e6..0b93c8523156f92fb2d459c43087c0d6a92366c8 100644
--- a/runtime/bin/vmstats/bargraph.dart
+++ b/runtime/bin/vmstats/bargraph.dart
@@ -218,6 +218,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);
}
}

Powered by Google App Engine
This is Rietveld 408576698