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

Side by Side Diff: runtime/lib/byte_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 | « runtime/lib/array.dart ('k') | runtime/lib/growable_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 patch class Int8List { 5 patch class Int8List {
6 /* patch */ factory Int8List(int length) { 6 /* patch */ factory Int8List(int length) {
7 return new _Int8Array(length); 7 return new _Int8Array(length);
8 } 8 }
9 9
10 /* patch */ factory Int8List.transferable(int length) { 10 /* patch */ factory Int8List.transferable(int length) {
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 throw new UnsupportedError( 277 throw new UnsupportedError(
278 "Cannot add to a non-extendable array"); 278 "Cannot add to a non-extendable array");
279 } 279 }
280 280
281 void addAll(Iterable value) { 281 void addAll(Iterable value) {
282 throw new UnsupportedError( 282 throw new UnsupportedError(
283 "Cannot add to a non-extendable array"); 283 "Cannot add to a non-extendable array");
284 } 284 }
285 285
286 void sort([int compare(var a, var b)]) { 286 void sort([int compare(var a, var b)]) {
287 if (compare == null) compare = Comparable.compare; 287 return IterableMixinWorkaround.sortList(this, compare);
288 coreSort(this, compare);
289 } 288 }
290 289
291 int indexOf(element, [int start = 0]) { 290 int indexOf(element, [int start = 0]) {
292 return Arrays.indexOf(this, element, start, this.length); 291 return Arrays.indexOf(this, element, start, this.length);
293 } 292 }
294 293
295 int lastIndexOf(element, [int start = null]) { 294 int lastIndexOf(element, [int start = null]) {
296 if (start == null) start = length - 1; 295 if (start == null) start = length - 1;
297 return Arrays.lastIndexOf(this, element, start); 296 return Arrays.lastIndexOf(this, element, start);
298 } 297 }
(...skipping 1682 matching lines...) Expand 10 before | Expand all | Expand 10 after
1981 throw new UnsupportedError( 1980 throw new UnsupportedError(
1982 "Cannot add to a non-extendable array"); 1981 "Cannot add to a non-extendable array");
1983 } 1982 }
1984 1983
1985 void addAll(Iterable value) { 1984 void addAll(Iterable value) {
1986 throw new UnsupportedError( 1985 throw new UnsupportedError(
1987 "Cannot add to a non-extendable array"); 1986 "Cannot add to a non-extendable array");
1988 } 1987 }
1989 1988
1990 void sort([int compare(var a, var b)]) { 1989 void sort([int compare(var a, var b)]) {
1991 if (compare == null) compare = Comparable.compare; 1990 return IterableMixinWorkaround.sortList(this, compare);
1992 coreSort(this, compare);
1993 } 1991 }
1994 1992
1995 int indexOf(element, [int start = 0]) { 1993 int indexOf(element, [int start = 0]) {
1996 return Arrays.indexOf(this, element, start, this.length); 1994 return Arrays.indexOf(this, element, start, this.length);
1997 } 1995 }
1998 1996
1999 int lastIndexOf(element, [int start = null]) { 1997 int lastIndexOf(element, [int start = null]) {
2000 if (start == null) start = length - 1; 1998 if (start == null) start = length - 1;
2001 return Arrays.lastIndexOf(this, element, start); 1999 return Arrays.lastIndexOf(this, element, start);
2002 } 2000 }
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
2704 ByteArray asByteArray([int start = 0, int length]) { 2702 ByteArray asByteArray([int start = 0, int length]) {
2705 if (length == null) { 2703 if (length == null) {
2706 length = this.lengthInBytes(); 2704 length = this.lengthInBytes();
2707 } 2705 }
2708 _rangeCheck(this.length, start, length); 2706 _rangeCheck(this.length, start, length);
2709 return _array.subByteArray(_offset + start, length); 2707 return _array.subByteArray(_offset + start, length);
2710 } 2708 }
2711 2709
2712 static const int _BYTES_PER_ELEMENT = 8; 2710 static const int _BYTES_PER_ELEMENT = 8;
2713 } 2711 }
OLDNEW
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/lib/growable_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698