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

Side by Side Diff: client/html/src/_ListIterators.dart

Issue 9655009: Remove files that have already been ported or do not need to be ported. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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 | « client/html/src/_FactoryProviders.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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Iterator for lists with fixed size.
6 class _FixedSizeListIterator<T> extends _VariableSizeListIterator<T> {
7 _FixedSizeListIterator(List<T> list)
8 : super(list),
9 _length = list.length;
10
11 bool hasNext() => _length > _pos;
12
13 final int _length; // Cache list length for faster access.
14 }
15
16 // Iterator for lists with variable size.
17 class _VariableSizeListIterator<T> implements Iterator<T> {
18 _VariableSizeListIterator(List<T> list)
19 : _list = list,
20 _pos = 0;
21
22 bool hasNext() => _list.length > _pos;
23
24 T next() {
25 if (!hasNext()) {
26 throw const NoMoreElementsException();
27 }
28 return _list[_pos++];
29 }
30
31 final List<T> _list;
32 int _pos;
33 }
OLDNEW
« no previous file with comments | « client/html/src/_FactoryProviders.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698