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

Unified Diff: runtime/lib/array.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: runtime/lib/array.dart
diff --git a/runtime/lib/array.dart b/runtime/lib/array.dart
index 8d87333d2e2a4052082a935caba2e2cacaa2a50d..01480f67f868c2d1094b7ff17a169ef6d7cdf53f 100644
--- a/runtime/lib/array.dart
+++ b/runtime/lib/array.dart
@@ -67,10 +67,7 @@ class _ObjectArray<E> implements List<E> {
Collections.forEach(this, f);
}
- Collection mappedBy(f(E element)) {
- return Collections.mappedBy(
- this, new _GrowableObjectArray.withCapacity(length), f);
- }
+ Iterable mappedBy(f(E element)) => new MappedIterable<E, dynamic>(this, f);
Ivan Posva 2012/11/26 18:29:09 We like our curlys. Please leave them in.
floitsch 2012/11/28 13:48:23 Done.
reduce(initialValue, combine(previousValue, E element)) {
return Collections.reduce(this, initialValue, combine);
@@ -215,10 +212,7 @@ class _ImmutableArray<E> implements List<E> {
Collections.forEach(this, f);
}
- Collection mappedBy(f(E element)) {
- return Collections.mappedBy(
- this, new _GrowableObjectArray.withCapacity(length), f);
- }
+ Iterable mappedBy(f(E element)) => new MappedIterable<E, dynamic>(this, f);
Ivan Posva 2012/11/26 18:29:09 ditto
floitsch 2012/11/28 13:48:23 Done.
reduce(initialValue, combine(previousValue, E element)) {
return Collections.reduce(this, initialValue, combine);

Powered by Google App Engine
This is Rietveld 408576698