Chromium Code Reviews| Index: sdk/lib/collection/collections.dart |
| diff --git a/sdk/lib/collection/collections.dart b/sdk/lib/collection/collections.dart |
| index f9e83eed8318f1e96d11b4265bf21b888b88a9e6..052af9f77521b564daca37df84a23d3c3eea504c 100644 |
| --- a/sdk/lib/collection/collections.dart |
| +++ b/sdk/lib/collection/collections.dart |
| @@ -313,12 +313,14 @@ class IterableMixinWorkaround { |
| return new WhereIterable(iterable, f); |
| } |
| - static List mappedByList(List list, f(var element)) { |
| + static Iterable mappedByList(List list, f(var element)) { |
|
floitsch
2013/01/30 14:48:44
Add a static Iterable map(Iterable, f) and use tha
Lasse Reichstein Nielsen
2013/01/31 11:33:49
Done.
|
| + // This is currently a List as well as an Iterable. |
| return new MappedList(list, f); |
| } |
| - static List takeList(List list, int n) { |
| + static Iterable takeList(List list, int n) { |
| // The generic type is currently lost. It will be fixed with mixins. |
| + // This is currently a List as well as an Iterable. |
| return new ListView(list, 0, n); |
| } |
| @@ -327,8 +329,9 @@ class IterableMixinWorkaround { |
| return new TakeWhileIterable(iterable, test); |
| } |
| - static List skipList(List list, int n) { |
| + static Iterable skipList(List list, int n) { |
| // The generic type is currently lost. It will be fixed with mixins. |
| + // This is currently a List as well as an Iterable. |
| return new ListView(list, n, null); |
| } |
| @@ -439,11 +442,11 @@ class Collections { |
| => IterableMixinWorkaround.where(iterable, f); |
| /** Deprecated. Use the same method in [IterableMixinWorkaround] instead.*/ |
| - static List mappedByList(List list, f(var element)) |
| + static Iterable mappedByList(List list, f(var element)) |
| => IterableMixinWorkaround.mappedByList(list, f); |
| /** Deprecated. Use the same method in [IterableMixinWorkaround] instead.*/ |
| - static List takeList(List list, int n) |
| + static Iterable takeList(List list, int n) |
| => IterableMixinWorkaround.takeList(list, n); |
| /** Deprecated. Use the same method in [IterableMixinWorkaround] instead.*/ |
| @@ -451,7 +454,7 @@ class Collections { |
| => IterableMixinWorkaround.takeWhile(iterable, test); |
| /** Deprecated. Use the same method in [IterableMixinWorkaround] instead.*/ |
| - static List skipList(List list, int n) |
| + static Iterable skipList(List list, int n) |
| => IterableMixinWorkaround.skipList(list, n); |
| /** Deprecated. Use the same method in [IterableMixinWorkaround] instead.*/ |