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

Unified Diff: runtime/lib/array_patch.dart

Issue 2968003004: Revert "The current growth strategy for growable arrays allocates a backing array of size 2 at (emp… (Closed)
Patch Set: Created 3 years, 5 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 | « no previous file | runtime/lib/growable_array.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/array_patch.dart
diff --git a/runtime/lib/array_patch.dart b/runtime/lib/array_patch.dart
index 463b0b77927ee13ad0f4ae8922124838f728105c..b1e5398127e89dac7626a4171c507d640f128828 100644
--- a/runtime/lib/array_patch.dart
+++ b/runtime/lib/array_patch.dart
@@ -47,6 +47,10 @@ class List<E> {
list.add(e);
}
if (growable) return list;
+ if (list.length == 0) {
+ // Avoid getting an immutable list from makeListFixedLength.
+ return new _List<E>(0);
+ }
return makeListFixedLength(list);
}
« no previous file with comments | « no previous file | runtime/lib/growable_array.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698