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: tools/dom/templates/immutable_list_mixin.darttemplate

Issue 12817003: Change getRange to sublist. Make getRange deprecated. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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: tools/dom/templates/immutable_list_mixin.darttemplate
diff --git a/tools/dom/templates/immutable_list_mixin.darttemplate b/tools/dom/templates/immutable_list_mixin.darttemplate
index bdaaaf8ba7aa98e23e66d69c1fe236c23797edf1..64912547c2e18c1aa65c87ca8a28f3566226ae55 100644
--- a/tools/dom/templates/immutable_list_mixin.darttemplate
+++ b/tools/dom/templates/immutable_list_mixin.darttemplate
@@ -184,8 +184,13 @@ $endif
throw new UnsupportedError("Cannot insertRange on immutable List.");
}
+ List<$E> sublist(int start, [int end]) {
+ if (end == null) end = length;
+ return Lists.getRange(this, start, end, <$E>[]);
+ }
+
List<$E> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <$E>[]);
+ sublist(start, start + rangeLength);
Map<int, $E> asMap() =>
IterableMixinWorkaround.asMapList(this);

Powered by Google App Engine
This is Rietveld 408576698