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

Unified Diff: sdk/lib/collection/list.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 | « sdk/lib/_internal/dartdoc/lib/src/markdown/inline_parser.dart ('k') | sdk/lib/core/list.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/collection/list.dart
diff --git a/sdk/lib/collection/list.dart b/sdk/lib/collection/list.dart
index 4b9e0f1ec5b1a0b4104585a21fc3c0670b589fe1..84d9208f21b94ea77c08c17d73732d7340e1d12e 100644
--- a/sdk/lib/collection/list.dart
+++ b/sdk/lib/collection/list.dart
@@ -342,14 +342,14 @@ abstract class ListMixin<E> implements List<E> {
}
}
- void removeRange(int start, int length) {
+ void removeRange(int start, int end) {
if (start < 0 || start > this.length) {
throw new RangeError.range(start, 0, this.length);
}
- if (length < 0 || start + length > this.length) {
- throw new RangeError.range(length, 0, this.length - start);
+ if (end < start || end > this.length) {
+ throw new RangeError.range(end, start, this.length);
}
- int end = start + length;
+ int length = end - start;
setRange(start, this.length - length, this, end);
this.length -= length;
}
« no previous file with comments | « sdk/lib/_internal/dartdoc/lib/src/markdown/inline_parser.dart ('k') | sdk/lib/core/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698