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

Unified Diff: sdk/lib/core/list.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 | « sdk/lib/core/errors.dart ('k') | sdk/lib/html/html_common/filtered_element_list.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/list.dart
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index 2ab0a06151d43353b71fbb2b382bda05b3108e67..50cf3b161bde0c68e795781bd8e24ca951f30079 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -85,6 +85,15 @@ abstract class List<E> implements Collection<E> {
void addAll(Iterable<E> iterable);
/**
+ * Returns a reversed fixed-length view of this [List].
+ *
+ * The reversed list has elements in the opposite order of this list.
+ * It is backed by this list, but will stop working if this list
+ * becomes shorter than its current length.
+ */
+ List<T> get reversed => new ReversedList(this, 0, length);
+
+ /**
* Sorts the list according to the order specified by the [compare] function.
*
* The [compare] function must act as a [Comparator].
« no previous file with comments | « sdk/lib/core/errors.dart ('k') | sdk/lib/html/html_common/filtered_element_list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698