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

Unified Diff: sdk/lib/collection/list.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 | « 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 9128228f71f5e02d3a8bd6e57ddfeee9f08c2f4f..47829d64706f36f56825dff991ae0f78036e0c9a 100644
--- a/sdk/lib/collection/list.dart
+++ b/sdk/lib/collection/list.dart
@@ -324,29 +324,14 @@ abstract class ListMixin<E> implements List<E> {
return new SubListIterable(this, start, end);
}
- void insertRange(int start, int length, [E initialValue]) {
+ void removeRange(int start, int end) {
if (start < 0 || start > this.length) {
throw new RangeError.range(start, 0, this.length);
}
- int oldLength = this.length;
- int moveLength = oldLength - start;
- this.length += length;
- if (moveLength > 0) {
- this.setRange(start + length, oldLength, this, start);
- }
- for (int i = 0; i < length; i++) {
- this[start + i] = initialValue;
- }
- }
-
- void removeRange(int start, int length) {
- 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