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

Unified Diff: runtime/lib/byte_array.dart

Issue 11000025: Revert hiding of VM-only coreimpl list implementation types. While I (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months 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
« no previous file with comments | « runtime/lib/array_patch.dart ('k') | runtime/lib/growable_array.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/byte_array.dart
diff --git a/runtime/lib/byte_array.dart b/runtime/lib/byte_array.dart
index a6efae205473d075a9ed794c0464b41f25f6a40b..0897917bb0d6396229e1897b9c53fe84e5209ca7 100644
--- a/runtime/lib/byte_array.dart
+++ b/runtime/lib/byte_array.dart
@@ -131,7 +131,9 @@ abstract class _ByteArrayBase {
}
Collection map(f(element)) {
- return Collections.map(this, new List(), f);
+ return Collections.map(this,
+ new GrowableObjectArray.withCapacity(length),
+ f);
}
Dynamic reduce(Dynamic initialValue,
@@ -140,7 +142,7 @@ abstract class _ByteArrayBase {
}
Collection filter(bool f(element)) {
- return Collections.filter(this, new List(), f);
+ return Collections.filter(this, new GrowableObjectArray(), f);
}
bool every(bool f(element)) {
@@ -1608,7 +1610,9 @@ class _ByteArrayViewBase {
}
Collection map(f(element)) {
- return Collections.map(this, new List(), f);
+ return Collections.map(this,
+ new GrowableObjectArray.withCapacity(length),
+ f);
}
Dynamic reduce(Dynamic initialValue,
@@ -1617,7 +1621,7 @@ class _ByteArrayViewBase {
}
Collection filter(bool f(element)) {
- return Collections.filter(this, new List(), f);
+ return Collections.filter(this, new GrowableObjectArray(), f);
}
bool every(bool f(element)) {
« no previous file with comments | « runtime/lib/array_patch.dart ('k') | runtime/lib/growable_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698