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

Side by Side Diff: runtime/lib/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
« no previous file with comments | « no previous file | runtime/lib/byte_array.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 5
6 // TODO(srdjan): Use shared array implementation. 6 // TODO(srdjan): Use shared array implementation.
7 class _ObjectArray<E> implements List<E> { 7 class _ObjectArray<E> implements List<E> {
8 8
9 factory _ObjectArray(int length) native "ObjectArray_allocate"; 9 factory _ObjectArray(int length) native "ObjectArray_allocate";
10 10
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 148
149 E elementAt(int index) { 149 E elementAt(int index) {
150 return this[index]; 150 return this[index];
151 } 151 }
152 152
153 bool get isEmpty { 153 bool get isEmpty {
154 return this.length == 0; 154 return this.length == 0;
155 } 155 }
156 156
157 void sort([int compare(E a, E b)]) { 157 void sort([int compare(E a, E b)]) {
158 if (compare == null) compare = Comparable.compare; 158 IterableMixinWorkaround.sortList(this, compare);
159 _Sort.sort(this, compare);
160 } 159 }
161 160
162 int indexOf(E element, [int start = 0]) { 161 int indexOf(E element, [int start = 0]) {
163 return Arrays.indexOf(this, element, start, this.length); 162 return Arrays.indexOf(this, element, start, this.length);
164 } 163 }
165 164
166 int lastIndexOf(E element, [int start = null]) { 165 int lastIndexOf(E element, [int start = null]) {
167 if (start == null) start = length - 1; 166 if (start == null) start = length - 1;
168 return Arrays.lastIndexOf(this, element, start); 167 return Arrays.lastIndexOf(this, element, start);
169 } 168 }
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 } 484 }
486 _position = _length; 485 _position = _length;
487 _current = null; 486 _current = null;
488 return false; 487 return false;
489 } 488 }
490 489
491 E get current { 490 E get current {
492 return _current; 491 return _current;
493 } 492 }
494 } 493 }
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/byte_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698