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

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

Issue 11412086: Make 'where' lazy. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Rebase 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 2f6115715f6284bbc520a8f13475ce1e91763c86..25f39e01628e06bc93911843cee2d50cd4d15c76 100644
--- a/sdk/lib/_internal/compiler/implementation/tree/nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/tree/nodes.dart
@@ -473,11 +473,8 @@ class NodeList extends Node implements Iterable<Node> {
// mechanism.
Iterable mappedBy(f(Node element)) => new MappedIterable(this, f);
- Collection<Node> where(bool f(Node element)) {
- List result = <Node>[];
- for (Node element in this) if (f(element)) result.add(element);
- return result;
- }
+ Iterable<Node> where(bool f(Node element))
+ => new FilteredIterable<Node>(this, f);
bool contains(Node element) {
for (Node e in this) {

Powered by Google App Engine
This is Rietveld 408576698