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

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

Issue 11280049: Use coreSort in bytearrays.. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | no next file » | 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.view(ByteArray array, 10 /* patch */ factory Int8List.view(ByteArray array,
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 throw new UnsupportedError( 177 throw new UnsupportedError(
178 "Cannot add to a non-extendable array"); 178 "Cannot add to a non-extendable array");
179 } 179 }
180 180
181 void addAll(Collection value) { 181 void addAll(Collection value) {
182 throw new UnsupportedError( 182 throw new UnsupportedError(
183 "Cannot add to a non-extendable array"); 183 "Cannot add to a non-extendable array");
184 } 184 }
185 185
186 void sort([Comparator compare = Comparable.compare]) { 186 void sort([Comparator compare = Comparable.compare]) {
187 _Sort.sort(this, compare); 187 coreSort(this, compare);
188 } 188 }
189 189
190 int indexOf(element, [int start = 0]) { 190 int indexOf(element, [int start = 0]) {
191 return Arrays.indexOf(this, element, start, this.length); 191 return Arrays.indexOf(this, element, start, this.length);
192 } 192 }
193 193
194 int lastIndexOf(element, [int start = null]) { 194 int lastIndexOf(element, [int start = null]) {
195 if (start == null) start = length - 1; 195 if (start == null) start = length - 1;
196 return Arrays.lastIndexOf(this, element, start); 196 return Arrays.lastIndexOf(this, element, start);
197 } 197 }
(...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after
1659 throw new UnsupportedError( 1659 throw new UnsupportedError(
1660 "Cannot add to a non-extendable array"); 1660 "Cannot add to a non-extendable array");
1661 } 1661 }
1662 1662
1663 void addAll(Collection value) { 1663 void addAll(Collection value) {
1664 throw new UnsupportedError( 1664 throw new UnsupportedError(
1665 "Cannot add to a non-extendable array"); 1665 "Cannot add to a non-extendable array");
1666 } 1666 }
1667 1667
1668 void sort([Comparator compare = Comparable.compare]) { 1668 void sort([Comparator compare = Comparable.compare]) {
1669 _Sort.sort(this, compare); 1669 coreSort(this, compare);
1670 } 1670 }
1671 1671
1672 int indexOf(element, [int start = 0]) { 1672 int indexOf(element, [int start = 0]) {
1673 return Arrays.indexOf(this, element, start, this.length); 1673 return Arrays.indexOf(this, element, start, this.length);
1674 } 1674 }
1675 1675
1676 int lastIndexOf(element, [int start = null]) { 1676 int lastIndexOf(element, [int start = null]) {
1677 if (start == null) start = length - 1; 1677 if (start == null) start = length - 1;
1678 return Arrays.lastIndexOf(this, element, start); 1678 return Arrays.lastIndexOf(this, element, start);
1679 } 1679 }
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
2419 } 2419 }
2420 _rangeCheck(this.length, start, length); 2420 _rangeCheck(this.length, start, length);
2421 return _array.subByteArray(_offset + start, length); 2421 return _array.subByteArray(_offset + start, length);
2422 } 2422 }
2423 2423
2424 static const int _BYTES_PER_ELEMENT = 8; 2424 static const int _BYTES_PER_ELEMENT = 8;
2425 final ByteArray _array; 2425 final ByteArray _array;
2426 final int _offset; 2426 final int _offset;
2427 final int _length; 2427 final int _length;
2428 } 2428 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698