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

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: Merge to head. 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..b82949c3584ee4ef3e94c445646fca7cfc5947a5 100644
--- a/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart
+++ b/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart
@@ -81,12 +81,8 @@ class LinkEntry<T> extends Link<T> {
bool get isEmpty => false;
- List<T> toList() {
- List<T> list = new List<T>();
- for (Link<T> link = this; !link.isEmpty; link = link.tail) {
- list.addLast(link.head);
- }
- return list;
+ List<T> toList({ bool growable: false }) {
+ return new List<T>.from(this, growable: growable);
}
void forEach(void f(T element)) {

Powered by Google App Engine
This is Rietveld 408576698