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

Unified Diff: runtime/lib/byte_array.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: runtime/lib/byte_array.dart
diff --git a/runtime/lib/byte_array.dart b/runtime/lib/byte_array.dart
index d6cd4e430ef3fbfb7a517bc09c3ca14a42d2a102..afe5eb25a36682cfe466e19801d535cc87cbfdca 100644
--- a/runtime/lib/byte_array.dart
+++ b/runtime/lib/byte_array.dart
@@ -132,8 +132,8 @@ abstract class _ByteArrayBase {
}
}
- Collection mappedBy(f(element)) {
- return Collections.mappedBy(this, new List(), f);
+ Iterable mappedBy(f(element)) {
+ return new MappedIterable(this, f);
}
Dynamic reduce(Dynamic initialValue,
@@ -1612,7 +1612,7 @@ class _ByteArrayView implements ByteArray {
}
-class _ByteArrayViewBase {
+class _ByteArrayViewBase extends Collection<int> {
abstract num operator[](int index);
// Methods implementing the Collection interface.
@@ -1624,27 +1624,6 @@ class _ByteArrayViewBase {
}
}
- Collection mappedBy(f(element)) {
- return Collections.mappedBy(this, new List(), f);
- }
-
- Dynamic reduce(Dynamic initialValue,
- Dynamic combine(Dynamic initialValue, element)) {
- return Collections.reduce(this, initialValue, combine);
- }
-
- Collection where(bool f(element)) {
- return Collections.where(this, new List(), f);
- }
-
- bool every(bool f(element)) {
- return Collections.every(this, f);
- }
-
- bool some(bool f(element)) {
- return Collections.some(this, f);;
- }
-
bool get isEmpty {
return this.length == 0;
}

Powered by Google App Engine
This is Rietveld 408576698