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

Side by Side Diff: tools/dom/src/_ListIterators.dart

Issue 2827793002: Format all files under tools and utils directory. (Closed)
Patch Set: Format all files under tools and utils directory. Created 3 years, 8 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
« no previous file with comments | « tools/dom/src/_HttpRequestUtils.dart ('k') | tools/dom/src/_chrome/app_runtime.dart » ('j') | 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 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> implements Iterator<T> { 8 class FixedSizeListIterator<T> implements Iterator<T> {
9 final List<T> _array; 9 final List<T> _array;
10 final int _length; // Cache array length for faster access. 10 final int _length; // Cache array length for faster access.
11 int _position; 11 int _position;
12 T _current; 12 T _current;
13 13
14 FixedSizeListIterator(List<T> array) 14 FixedSizeListIterator(List<T> array)
15 : _array = array, 15 : _array = array,
16 _position = -1, 16 _position = -1,
17 _length = array.length; 17 _length = array.length;
18 18
19 bool moveNext() { 19 bool moveNext() {
20 int nextPosition = _position + 1; 20 int nextPosition = _position + 1;
21 if (nextPosition < _length) { 21 if (nextPosition < _length) {
22 _current = _array[nextPosition]; 22 _current = _array[nextPosition];
23 _position = nextPosition; 23 _position = nextPosition;
(...skipping 24 matching lines...) Expand all
48 _position = nextPosition; 48 _position = nextPosition;
49 return true; 49 return true;
50 } 50 }
51 _current = null; 51 _current = null;
52 _position = _array.length; 52 _position = _array.length;
53 return false; 53 return false;
54 } 54 }
55 55
56 T get current => _current; 56 T get current => _current;
57 } 57 }
OLDNEW
« no previous file with comments | « tools/dom/src/_HttpRequestUtils.dart ('k') | tools/dom/src/_chrome/app_runtime.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698