Index: sdk/lib/_collection_dev/iterable.dart |
diff --git a/sdk/lib/_collection_dev/iterable.dart b/sdk/lib/_collection_dev/iterable.dart |
index 25515a9f9a63f65a5d948ff78162a9bac32458bc..e8a6a956ac1fbb62d61f8260cf789b694dc8e042 100644 |
--- a/sdk/lib/_collection_dev/iterable.dart |
+++ b/sdk/lib/_collection_dev/iterable.dart |
@@ -200,6 +200,10 @@ abstract class ListIterable<E> extends Iterable<E> { |
Iterable map(f(E element)) => new MappedListIterable(this, f); |
reduce(var initialValue, combine(var previousValue, E element)) { |
+ return fold(initialValue, combine); |
+ } |
+ |
+ fold(var initialValue, combine(var previousValue, E element)) { |
var value = initialValue; |
int length = this.length; |
for (int i = 0; i < length; i++) { |
@@ -670,6 +674,10 @@ class EmptyIterable<E> extends Iterable<E> { |
Iterable map(f(E element)) => const EmptyIterable(); |
reduce(var initialValue, combine(var previousValue, E element)) { |
+ return fold(initialValue, combine); |
+ } |
+ |
+ fold(var initialValue, combine(var previousValue, E element)) { |
return initialValue; |
} |