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

Unified Diff: runtime/lib/growable_array.dart

Issue 13872007: Refactor removeRange. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files and rebuild dom (unrelated CL). 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..6813485435aee7cd1c7b3a228880c6315dbfca8e 100644
--- a/runtime/lib/growable_array.dart
+++ b/runtime/lib/growable_array.dart
@@ -69,17 +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;
+ this.length - end);
+ this.length = this.length - (end - start);
}
void insertRange(int start, int length, [T initialValue = null]) {
« 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