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

Unified Diff: runtime/lib/array.dart

Issue 2685783009: (Re)move methods from internal.Lists that are not used, or only used once. (Closed)
Patch Set: Merge to head. Created 3 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 | « no previous file | runtime/lib/internal_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/array.dart
diff --git a/runtime/lib/array.dart b/runtime/lib/array.dart
index cf124ba6259c9e72c2f16e9a12b978e7bd910dd3..aab9f31a6c69b8d8f31b4768245e6ff22c25ee3f 100644
--- a/runtime/lib/array.dart
+++ b/runtime/lib/array.dart
@@ -60,10 +60,9 @@ class _List<E> extends FixedLengthListBase<E> {
}
List<E> sublist(int start, [int end]) {
- Lists.indicesCheck(this, start, end);
- if (end == null) end = this.length;
+ end = RangeError.checkValidRange(start, end, this.length);
int length = end - start;
- if (start == end) return <E>[];
+ if (length == 0) return <E>[];
var result = new _GrowableList<E>.withData(_slice(start, length, false));
result._setLength(length);
return result;
@@ -136,8 +135,7 @@ class _ImmutableList<E> extends UnmodifiableListBase<E> {
int get length native "List_getLength";
List<E> sublist(int start, [int end]) {
- Lists.indicesCheck(this, start, end);
- if (end == null) end = this.length;
+ end = RangeError.checkValidRange(start, end, this.length);
int length = end - start;
if (length == 0) return <E>[];
List list = new _List(length);
« no previous file with comments | « no previous file | runtime/lib/internal_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698