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

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

Issue 10928051: Remove more () from getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | « runtime/lib/array.dart ('k') | runtime/lib/regexp_patch.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 GrowableObjectArray<T> implements List<T> { 5 class GrowableObjectArray<T> implements List<T> {
6 factory GrowableObjectArray._uninstantiable() { 6 factory GrowableObjectArray._uninstantiable() {
7 throw const UnsupportedOperationException( 7 throw const UnsupportedOperationException(
8 "GrowableObjectArray can only be allocated by the VM"); 8 "GrowableObjectArray can only be allocated by the VM");
9 } 9 }
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 factory GrowableObjectArray.from(Collection<T> other) { 72 factory GrowableObjectArray.from(Collection<T> other) {
73 List<T> result = new GrowableObjectArray<T>(); 73 List<T> result = new GrowableObjectArray<T>();
74 result.addAll(other); 74 result.addAll(other);
75 return result; 75 return result;
76 } 76 }
77 77
78 factory GrowableObjectArray.fromObjectArray(ObjectArray<T> data) 78 factory GrowableObjectArray.fromObjectArray(ObjectArray<T> data)
79 native "GrowableObjectArray_allocate"; 79 native "GrowableObjectArray_allocate";
80 80
81 int get length() native "GrowableObjectArray_getLength"; 81 int get length native "GrowableObjectArray_getLength";
82 82
83 int get capacity() native "GrowableObjectArray_getCapacity"; 83 int get capacity native "GrowableObjectArray_getCapacity";
84 84
85 void set length(int new_length) { 85 void set length(int new_length) {
86 if (new_length > capacity) { 86 if (new_length > capacity) {
87 _grow(new_length); 87 _grow(new_length);
88 } else { 88 } else {
89 for (int i = new_length; i < length; i++) { 89 for (int i = new_length; i < length; i++) {
90 this[i] = null; 90 this[i] = null;
91 } 91 }
92 } 92 }
93 _setLength(new_length); 93 _setLength(new_length);
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 T next() { 227 T next() {
228 if (!hasNext()) { 228 if (!hasNext()) {
229 throw const NoMoreElementsException(); 229 throw const NoMoreElementsException();
230 } 230 }
231 return _array[_pos++]; 231 return _array[_pos++];
232 } 232 }
233 233
234 final GrowableObjectArray<T> _array; 234 final GrowableObjectArray<T> _array;
235 int _pos; 235 int _pos;
236 } 236 }
OLDNEW
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/lib/regexp_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698