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

Unified Diff: runtime/lib/typeddata.dart

Issue 12817003: Change getRange to sublist. Make getRange deprecated. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 9 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
Index: runtime/lib/typeddata.dart
diff --git a/runtime/lib/typeddata.dart b/runtime/lib/typeddata.dart
index 6f9b86b1a24fe6565ad1c0d91742aefe61041568..6129ae694d991a97e542df38d4284bf1f001169a 100644
--- a/runtime/lib/typeddata.dart
+++ b/runtime/lib/typeddata.dart
@@ -434,13 +434,19 @@ abstract class _TypedListBase {
return new Set.from(this);
}
- List getRange(int start, int length) {
+ List sublist(int start, [int end]) {
+ if (end == null) end = length;
+ int length = end - start;
_rangeCheck(this.length, start, length);
List result = _createList(length);
result.setRange(0, length, this, start);
return result;
}
+ List getRange(int start, int length) {
+ return sublist(start, start + length);
+ }
+
void setRange(int start, int length, List from, [int startFrom = 0]) {
IterableMixinWorkaround.setRangeList(this, start, length, from, startFrom);
}
@@ -1521,7 +1527,7 @@ class _ExternalUint16Array extends _TypedList implements Uint16List {
class _ExternalInt32Array extends _TypedList implements Int32List {
// Factory constructors.
-
+
factory _ExternalInt32Array(int length) {
if (length < 0) {
String message = "$length must be greater than 0";

Powered by Google App Engine
This is Rietveld 408576698