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

Unified Diff: sdk/lib/collection/collections.dart

Issue 12094103: Added MappedListIterable/Iterator to implement map() on Lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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: sdk/lib/collection/collections.dart
diff --git a/sdk/lib/collection/collections.dart b/sdk/lib/collection/collections.dart
index 0c45e21d4250f85f4e04110279d4fb89403f8e76..369a3d3edab79ac00a7d3db1d1bbda6926dd912a 100644
--- a/sdk/lib/collection/collections.dart
+++ b/sdk/lib/collection/collections.dart
@@ -317,6 +317,10 @@ class IterableMixinWorkaround {
return new MappedIterable(iterable, f);
}
+ static Iterable mapList(List list, f(var element)) {
+ return new MappedListIterable(list, f, 0, null);
+ }
+
static List mappedByList(List list, f(var element)) {
// This is currently a List as well as an Iterable.
return new MappedList(list, f);

Powered by Google App Engine
This is Rietveld 408576698