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

Side by Side Diff: dart/lib/compiler/implementation/util/link_implementation.dart

Issue 10876008: Remove most superfluous getter arguments from dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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
« no previous file with comments | « dart/lib/compiler/implementation/universe.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class LinkIterator<T> implements Iterator<T> { 5 class LinkIterator<T> implements Iterator<T> {
6 Link<T> current; 6 Link<T> current;
7 LinkIterator(Link<T> this.current); 7 LinkIterator(Link<T> this.current);
8 bool hasNext() => !current.isEmpty(); 8 bool hasNext() => !current.isEmpty();
9 T next() { 9 T next() {
10 T result = current.head; 10 T result = current.head;
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 Link link = new Link<T>(list.last()); 35 Link link = new Link<T>(list.last());
36 for (int i = list.length - 1; i > 0; i--) { 36 for (int i = list.length - 1; i > 0; i--) {
37 link = link.prepend(list[i - 1]); 37 link = link.prepend(list[i - 1]);
38 } 38 }
39 return link; 39 return link;
40 } 40 }
41 } 41 }
42 42
43 class LinkTail<T> implements EmptyLink<T> { 43 class LinkTail<T> implements EmptyLink<T> {
44 T get head() => null; 44 T get head => null;
45 Link<T> get tail() => null; 45 Link<T> get tail => null;
46 46
47 const LinkTail(); 47 const LinkTail();
48 48
49 Link<T> prepend(T element) { 49 Link<T> prepend(T element) {
50 // TODO(ahe): Use new Link<T>, but this cost 8% performance on VM. 50 // TODO(ahe): Use new Link<T>, but this cost 8% performance on VM.
51 return new LinkEntry<T>(element, this); 51 return new LinkEntry<T>(element, this);
52 } 52 }
53 53
54 Iterator<T> iterator() => new LinkIterator<T>(this); 54 Iterator<T> iterator() => new LinkIterator<T>(this);
55 55
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 length++; 156 length++;
157 LinkEntry<T> entry = new LinkEntry<T>(t, null); 157 LinkEntry<T> entry = new LinkEntry<T>(t, null);
158 if (head === null) { 158 if (head === null) {
159 head = entry; 159 head = entry;
160 } else { 160 } else {
161 lastLink.tail = entry; 161 lastLink.tail = entry;
162 } 162 }
163 lastLink = entry; 163 lastLink = entry;
164 } 164 }
165 } 165 }
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/universe.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698