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

Unified Diff: runtime/lib/array.dart

Issue 11896013: Add List.reversed to give a reverse fixed-length view of a list. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Moved some functionality to separate CL. Created 7 years, 11 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 | « pkg/serialization/lib/src/serialization_rule.dart ('k') | runtime/lib/growable_array.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 d7fac3ad174401f9778185bcc01bd4080fa78db5..e7c4bee5b9b9f28652adcc711b2e4d5d1dcff822 100644
--- a/runtime/lib/array.dart
+++ b/runtime/lib/array.dart
@@ -154,6 +154,8 @@ class _ObjectArray<E> implements List<E> {
return this.length == 0;
}
+ List<E> get reversed => new ReversedListView<E>(this, 0, null);
+
void sort([int compare(E a, E b)]) {
IterableMixinWorkaround.sortList(this, compare);
}
@@ -382,6 +384,8 @@ class _ImmutableArray<E> implements List<E> {
return this.length == 0;
}
+ List<E> get reversed => new ReversedListView<E>(this, 0, null);
+
void sort([int compare(E a, E b)]) {
throw new UnsupportedError(
"Cannot modify an immutable array");
« no previous file with comments | « pkg/serialization/lib/src/serialization_rule.dart ('k') | runtime/lib/growable_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698