Index: sdk/lib/collection/collections.dart |
diff --git a/sdk/lib/collection/collections.dart b/sdk/lib/collection/collections.dart |
index 16290e57949335947138e6c74c2225a9702754a8..8729452b7b2cf3b830c0a386a27f23d91529f7f0 100644 |
--- a/sdk/lib/collection/collections.dart |
+++ b/sdk/lib/collection/collections.dart |
@@ -40,6 +40,12 @@ class IterableMixinWorkaround { |
static dynamic reduce(Iterable iterable, |
dynamic initialValue, |
dynamic combine(dynamic previousValue, element)) { |
+ return fold(iterable, initialValue, combine); |
+ } |
+ |
+ static dynamic fold(Iterable iterable, |
+ dynamic initialValue, |
+ dynamic combine(dynamic previousValue, element)) { |
for (final element in iterable) { |
initialValue = combine(initialValue, element); |
} |