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

Side by Side Diff: runtime/lib/array.dart

Issue 8431028: Implement async file API on top of isolates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Line length. Created 9 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 class ListFactory<T> { 5 class ListFactory<T> {
6 6
7 factory List.from(Iterable<T> other) { 7 factory List.from(Iterable<T> other) {
8 GrowableObjectArray<T> list = new GrowableObjectArray<T>(); 8 GrowableObjectArray<T> list = new GrowableObjectArray<T>();
9 for (final e in other) { 9 for (final e in other) {
10 list.add(e); 10 list.add(e);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 void _copyFromObjectArray(ObjectArray src, 59 void _copyFromObjectArray(ObjectArray src,
60 int srcStart, 60 int srcStart,
61 int dstStart, 61 int dstStart,
62 int count) 62 int count)
63 native "ObjectArray_copyFromObjectArray"; 63 native "ObjectArray_copyFromObjectArray";
64 64
65 void setRange(int start, int length, List<T> from, [int startFrom = 0]) { 65 void setRange(int start, int length, List<T> from, [int startFrom = 0]) {
66 if (length < 0) { 66 if (length < 0) {
67 throw new IllegalArgumentException("negative length $length"); 67 throw new IllegalArgumentException("negative length $length");
68 } 68 }
69 copyFrom(from, start, startFrom, count); 69 copyFrom(from, startFrom, start, length);
70 } 70 }
71 71
72 void removeRange(int start, int length) { 72 void removeRange(int start, int length) {
73 throw const UnsupportedOperationException( 73 throw const UnsupportedOperationException(
74 "Cannot remove range of a non-extendable array"); 74 "Cannot remove range of a non-extendable array");
75 } 75 }
76 76
77 void insertRange(int start, int length, [T initialValue = null]) { 77 void insertRange(int start, int length, [T initialValue = null]) {
78 throw const UnsupportedOperationException( 78 throw const UnsupportedOperationException(
79 "Cannot insert range in a non-extendable array"); 79 "Cannot insert range in a non-extendable array");
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 if (!hasNext()) { 305 if (!hasNext()) {
306 throw const NoMoreElementsException(); 306 throw const NoMoreElementsException();
307 } 307 }
308 return _array[_pos++]; 308 return _array[_pos++];
309 } 309 }
310 310
311 final List<T> _array; 311 final List<T> _array;
312 final int _length; // Cache array length for faster access. 312 final int _length; // Cache array length for faster access.
313 int _pos; 313 int _pos;
314 } 314 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698