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

Side by Side Diff: sdk/lib/html/src/_ListIterators.dart

Issue 11398002: Splitting SVG types out of dart:html. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minifying. Created 8 years, 1 month 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
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 html; 5 part of html;
6 6
7 // Iterator for arrays with fixed size. 7 // Iterator for arrays with fixed size.
8 class _FixedSizeListIterator<T> extends _VariableSizeListIterator<T> { 8 class FixedSizeListIterator<T> extends _VariableSizeListIterator<T> {
9 _FixedSizeListIterator(List<T> array) 9 FixedSizeListIterator(List<T> array)
10 : super(array), 10 : super(array),
11 _length = array.length; 11 _length = array.length;
12 12
13 bool get hasNext => _length > _pos; 13 bool get hasNext => _length > _pos;
14 14
15 final int _length; // Cache array length for faster access. 15 final int _length; // Cache array length for faster access.
16 } 16 }
17 17
18 // Iterator for arrays with variable size. 18 // Iterator for arrays with variable size.
19 class _VariableSizeListIterator<T> implements Iterator<T> { 19 class _VariableSizeListIterator<T> implements Iterator<T> {
20 _VariableSizeListIterator(List<T> array) 20 _VariableSizeListIterator(List<T> array)
21 : _array = array, 21 : _array = array,
22 _pos = 0; 22 _pos = 0;
23 23
24 bool get hasNext => _array.length > _pos; 24 bool get hasNext => _array.length > _pos;
25 25
26 T next() { 26 T next() {
27 if (!hasNext) { 27 if (!hasNext) {
28 throw new StateError("No more elements"); 28 throw new StateError("No more elements");
29 } 29 }
30 return _array[_pos++]; 30 return _array[_pos++];
31 } 31 }
32 32
33 final List<T> _array; 33 final List<T> _array;
34 int _pos; 34 int _pos;
35 } 35 }
OLDNEW
« no previous file with comments | « sdk/lib/html/src/FilteredElementList.dart ('k') | sdk/lib/html/src/shared_FactoryProviders.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698