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

Unified Diff: runtime/lib/growable_array.dart

Issue 13956006: Remove insertRange. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebuild DOM (unrelated CL) and update status files. Created 7 years, 8 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/array.dart ('k') | runtime/lib/typeddata.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 404194b437e9090cade813f6b4b42153c4adf6b0..d19cc2f9df873fe0480058dd424ea2eecaee63b8 100644
--- a/runtime/lib/growable_array.dart
+++ b/runtime/lib/growable_array.dart
@@ -69,39 +69,14 @@ class _GrowableObjectArray<T> implements List<T> {
IterableMixinWorkaround.setRangeList(this, start, end, iterable, skipCount);
}
- void removeRange(int start, int length) {
- if (length == 0) {
- return;
- }
- Arrays.rangeCheck(this, start, length);
+ void removeRange(int start, int end) {
+ Arrays.indicesCheck(this, start, end);
Arrays.copy(this,
- start + length,
+ end,
this,
start,
- this.length - length - start);
- this.length = this.length - length;
- }
-
- void insertRange(int start, int length, [T initialValue = null]) {
- if (length == 0) {
- return;
- }
- if ((length < 0) || (length is! int)) {
- throw new ArgumentError("invalid length specified $length");
- }
- if (start < 0 || start > this.length) {
- throw new RangeError.value(start);
- }
- var old_length = this.length;
- this.length = old_length + length; // Will expand if needed.
- Arrays.copy(this,
- start,
- this,
- start + length,
- old_length - start);
- for (int i = start; i < start + length; i++) {
- this[i] = initialValue;
- }
+ this.length - end);
+ this.length = this.length - (end - start);
}
List<T> sublist(int start, [int end]) {
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/lib/typeddata.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698