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

Unified Diff: sdk/lib/core/sequences.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/core/sequences.dart
diff --git a/sdk/lib/core/sequences.dart b/sdk/lib/core/sequences.dart
index 340ba0188b337968b47a327cbd2afbd44b6a76a0..677f93e1fabcabc9c5b47b7a2d05cedef5c2a0aa 100644
--- a/sdk/lib/core/sequences.dart
+++ b/sdk/lib/core/sequences.dart
@@ -39,13 +39,7 @@ abstract class SequenceCollection<E> implements Collection<E>, Sequence<E> {
for (int i = 0; i < this.length; i++) f(this[i]);
}
- Collection mappedBy(f(E element)) {
- List result = new List();
- for (int i = 0; i < this.length; i++) {
- result.add(f(this[i]));
- }
- return result;
- }
+ Iterable mappedBy(f(E element)) => new MappedIterable<E, dynamic>(this, f);
bool contains(E value) {
for (int i = 0; i < sequence.length; i++) {

Powered by Google App Engine
This is Rietveld 408576698