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

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

Issue 11269004: Change List.sort to not have a default parameter value. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reverted used of ?compare Created 8 years 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/byte_array.dart ('k') | samples/swarm/swarm_ui_lib/observable/observable.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 new UnsupportedError( 7 throw new UnsupportedError(
8 "GrowableObjectArray can only be allocated by the VM"); 8 "GrowableObjectArray can only be allocated by the VM");
9 } 9 }
10 10
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 } 204 }
205 205
206 bool get isEmpty { 206 bool get isEmpty {
207 return this.length == 0; 207 return this.length == 0;
208 } 208 }
209 209
210 void clear() { 210 void clear() {
211 this.length = 0; 211 this.length = 0;
212 } 212 }
213 213
214 void sort([Comparator<T> compare = Comparable.compare]) { 214 void sort([int compare(T a, T b)]) {
215 if (compare == null) compare = Comparable.compare;
215 _Sort.sort(this, compare); 216 _Sort.sort(this, compare);
216 } 217 }
217 218
218 String toString() { 219 String toString() {
219 return Collections.collectionToString(this); 220 return Collections.collectionToString(this);
220 } 221 }
221 222
222 Iterator<T> iterator() { 223 Iterator<T> iterator() {
223 return new SequenceIterator<T>(this); 224 return new SequenceIterator<T>(this);
224 } 225 }
225 } 226 }
OLDNEW
« no previous file with comments | « runtime/lib/byte_array.dart ('k') | samples/swarm/swarm_ui_lib/observable/observable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698