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

Unified Diff: sdk/lib/_internal/compiler/implementation/util/link_implementation.dart

Issue 12328104: Change new List(n) to return fixed length list. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
Index: sdk/lib/_internal/compiler/implementation/util/link_implementation.dart
diff --git a/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart b/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart
index 2f9ea8414d63179db530781e952811e3671e5790..65358c6c4a3320db9d8bca23232da911aec43eb4 100644
--- a/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart
+++ b/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart
@@ -81,11 +81,14 @@ class LinkEntry<T> extends Link<T> {
bool get isEmpty => false;
- List<T> toList() {
+ List<T> toList({ bool growable: false }) {
floitsch 2013/02/26 13:54:19 => new List<T>.from(this, growable: growable);
Lasse Reichstein Nielsen 2013/02/26 15:26:00 Done.
List<T> list = new List<T>();
for (Link<T> link = this; !link.isEmpty; link = link.tail) {
list.addLast(link.head);
}
+ if (!growable) {
+ list = new List<T>.from(list);
+ }
return list;
}

Powered by Google App Engine
This is Rietveld 408576698