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

Unified Diff: sdk/lib/core/list.dart

Issue 12391046: Add List.asMap(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 10 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/collection/collections.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 516d0b2d811606bee061d85100949ca39a111054..560f08fe0766941312f5522f11ed53d6a4e1e570 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -257,4 +257,12 @@ abstract class List<E> implements Collection<E> {
* [start] is greater than the length of the list.
*/
void insertRange(int start, int length, [E fill]);
+
+ /**
+ * Returns an unmodifiable [Map] view of `this`.
+ *
+ * It has the indices of this list as keys, and the corresponding elements
+ * as values.
+ */
+ Map<int, E> asMap();
}
« no previous file with comments | « sdk/lib/collection/collections.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