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

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: 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: 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 598fde2fded9eb6429a26642ffc5d5e82f3ba97d..11aed324df9b08185954f5a03f19aaafa533cd23 100644
--- a/tools/dom/templates/immutable_list_mixin.darttemplate
+++ b/tools/dom/templates/immutable_list_mixin.darttemplate
@@ -188,8 +188,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