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

Unified Diff: samples/swarm/swarm_ui_lib/util/CollectionUtils.dart

Issue 11414069: Make mappedBy lazy. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Remove CollectionUtils.mappedBy in Swarm. Created 8 years, 1 month 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: samples/swarm/swarm_ui_lib/util/CollectionUtils.dart
diff --git a/samples/swarm/swarm_ui_lib/util/CollectionUtils.dart b/samples/swarm/swarm_ui_lib/util/CollectionUtils.dart
index ca515b10b3fce49c602eb4981442db2ea98fa307..fd4e2394a4061cb95ad31f54251c88bfe5ae445e 100644
--- a/samples/swarm/swarm_ui_lib/util/CollectionUtils.dart
+++ b/samples/swarm/swarm_ui_lib/util/CollectionUtils.dart
@@ -38,22 +38,6 @@ class CollectionUtils {
}
}
- // Collection<T> supports most of the ES 5 list methods, but it's missing
- // map.
-
- // TODO(jmesserly): we might want a version of this that return an iterable,
- // however JS, Python and Ruby versions are all eager.
- static List mappedBy(Iterable source, var mapper) {
- // TODO(jmesserly): I was trying to set the capacity here, but instead it
- // seems to create a fixed list. Hence assigning by index below.
- List result = new List(source is List ? (source as List).length : null);
- int i = 0;
- for (final item in source) {
- result[i++] = mapper(item);
- }
- return result;
- }
-
/**
* Finds the item in [source] that matches [test]. Returns null if
* no item matches. The typing should be:

Powered by Google App Engine
This is Rietveld 408576698