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

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: 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
Index: sdk/lib/core/list.dart
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index 1e10e864537f3c27883771a26154bcdaf8cec46f..f50bda0d78355bfbc5f029f256cb0b3c7f02a9ab 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -254,4 +254,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 a [Map] view of `this`.
Lasse Reichstein Nielsen 2013/03/04 08:28:37 Unmodifiable?
floitsch 2013/03/04 16:50:20 Done.
+ *
+ * The returned map has the integers `0` to `length - 1` as keys and this
+ * list as values.
Lasse Reichstein Nielsen 2013/03/04 08:28:37 It has the indices of this list as keys, and the c
floitsch 2013/03/04 16:50:20 Done.
+ */
+ Map<int, E> asMap();
}

Powered by Google App Engine
This is Rietveld 408576698