| OLD | NEW |
| 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 part of util_implementation; | 5 part of util_implementation; |
| 6 | 6 |
| 7 class LinkIterator<T> implements Iterator<T> { | 7 class LinkIterator<T> implements Iterator<T> { |
| 8 Link<T> current; | 8 Link<T> current; |
| 9 LinkIterator(Link<T> this.current); | 9 LinkIterator(Link<T> this.current); |
| 10 bool get hasNext => !current.isEmpty; | 10 bool get hasNext => !current.isEmpty; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 void addLast(T t) { | 110 void addLast(T t) { |
| 111 length++; | 111 length++; |
| 112 LinkEntry<T> entry = new LinkEntry<T>(t, null); | 112 LinkEntry<T> entry = new LinkEntry<T>(t, null); |
| 113 if (head == null) { | 113 if (head == null) { |
| 114 head = entry; | 114 head = entry; |
| 115 } else { | 115 } else { |
| 116 lastLink.tail = entry; | 116 lastLink.tail = entry; |
| 117 } | 117 } |
| 118 lastLink = entry; | 118 lastLink = entry; |
| 119 } | 119 } |
| 120 |
| 121 bool get isEmpty => length == 0; |
| 120 } | 122 } |
| OLD | NEW |