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

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

Issue 11960005: Move sort to collection-dev and remove coreSort. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Adapt for not moving IterableMixinWorkaround. Created 7 years, 11 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
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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 285
286 bool get isEmpty { 286 bool get isEmpty {
287 return this.length == 0; 287 return this.length == 0;
288 } 288 }
289 289
290 void clear() { 290 void clear() {
291 this.length = 0; 291 this.length = 0;
292 } 292 }
293 293
294 void sort([int compare(T a, T b)]) { 294 void sort([int compare(T a, T b)]) {
295 if (compare == null) compare = Comparable.compare; 295 IterableMixinWorkaround.sortList(this, compare);
296 _Sort.sort(this, compare);
297 } 296 }
298 297
299 String toString() { 298 String toString() {
300 return Collections.collectionToString(this); 299 return Collections.collectionToString(this);
301 } 300 }
302 301
303 Iterator<T> get iterator { 302 Iterator<T> get iterator {
304 return new ListIterator<T>(this); 303 return new ListIterator<T>(this);
305 } 304 }
306 305
307 List<T> toList() { 306 List<T> toList() {
308 return new List<T>.from(this); 307 return new List<T>.from(this);
309 } 308 }
310 309
311 Set<T> toSet() { 310 Set<T> toSet() {
312 return new Set<T>.from(this); 311 return new Set<T>.from(this);
313 } 312 }
314 } 313 }
OLDNEW
« no previous file with comments | « runtime/lib/byte_array.dart ('k') | sdk/lib/_internal/compiler/implementation/lib/js_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698