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

Side by Side Diff: tests/compiler/dart2js/link_helper.dart

Issue 177963002: Use List instead of Link in the type system. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library link_helper;
6 import '../../../sdk/lib/_internal/compiler/implementation/util/util.dart';
7 import '../../../sdk/lib/_internal/compiler/implementation/util/util_implementat ion.dart';
8
9 Link LinkFromList(List list) {
10 switch (list.length) {
11 case 0:
12 return new Link();
13 case 1:
14 return new LinkEntry(list[0]);
15 case 2:
16 return new LinkEntry(list[0], new LinkEntry(list[1]));
17 case 3:
18 return new LinkEntry(
19 list[0], new LinkEntry(list[1], new LinkEntry(list[2])));
20 }
21 Link link = new Link();
22 for (int i = list.length; i > 0; i--) {
23 link = link.prepend(list[i - 1]);
24 }
25 return link;
26 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/least_upper_bound_test.dart ('k') | tests/compiler/dart2js/link_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698