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

Unified Diff: sdk/lib/_internal/compiler/implementation/tree/nodes.dart

Issue 11414069: Make mappedBy lazy. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Reupload due to error. 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: sdk/lib/_internal/compiler/implementation/tree/nodes.dart
diff --git a/sdk/lib/_internal/compiler/implementation/tree/nodes.dart b/sdk/lib/_internal/compiler/implementation/tree/nodes.dart
index 3e241bfce754e9a0192c39dbc9c57a81c3443264..2f6115715f6284bbc520a8f13475ce1e91763c86 100644
--- a/sdk/lib/_internal/compiler/implementation/tree/nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/tree/nodes.dart
@@ -471,11 +471,7 @@ class NodeList extends Node implements Iterable<Node> {
//
// TODO(floitsch): these functions should be pulled in through a mixin
// mechanism.
- Collection mappedBy(f(Node element)) {
- List result = [];
- for (Node element in this) result.add(f(element));
- return result;
- }
+ Iterable mappedBy(f(Node element)) => new MappedIterable(this, f);
Collection<Node> where(bool f(Node element)) {
List result = <Node>[];

Powered by Google App Engine
This is Rietveld 408576698