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

Unified Diff: runtime/lib/growable_array.dart

Issue 12386072: Move Arrays class to private library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/byte_array.dart ('k') | runtime/lib/simd128.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/growable_array.dart
diff --git a/runtime/lib/growable_array.dart b/runtime/lib/growable_array.dart
index 38e2db66aa2009d628b16ec627ae5b05f72943f6..5759178e8609c68362b633b77af9dbea899808bf 100644
--- a/runtime/lib/growable_array.dart
+++ b/runtime/lib/growable_array.dart
@@ -48,10 +48,7 @@ class _GrowableObjectArray<T> implements List<T> {
}
void setRange(int start, int length, List<T> from, [int startFrom = 0]) {
- if (length < 0) {
- throw new ArgumentError("negative length $length");
- }
- Arrays.copy(from, startFrom, this, start, length);
+ IterableMixinWorkaround.setRangeList(this, start, length, from, startFrom);
}
void removeRange(int start, int length) {
@@ -194,12 +191,11 @@ class _GrowableObjectArray<T> implements List<T> {
T max([int compare(T a, T b)]) => IterableMixinWorkaround.max(this, compare);
int indexOf(T element, [int start = 0]) {
- return Arrays.indexOf(this, element, start, length);
+ return IterableMixinWorkaround.indexOfList(this, element, start);
}
int lastIndexOf(T element, [int start = null]) {
- if (start == null) start = length - 1;
- return Arrays.lastIndexOf(this, element, start);
+ return IterableMixinWorkaround.lastIndexOfList(this, element, start);
}
void _grow(int new_length) {
« no previous file with comments | « runtime/lib/byte_array.dart ('k') | runtime/lib/simd128.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698