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

Unified Diff: runtime/lib/array.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: runtime/lib/array.dart
diff --git a/runtime/lib/array.dart b/runtime/lib/array.dart
index 688cfb5e02380e9ee38e4b5c0a10da678da99c7c..c8ff88869162739b9c8ab4efd066152ae15da192 100644
--- a/runtime/lib/array.dart
+++ b/runtime/lib/array.dart
@@ -235,6 +235,10 @@ class _ObjectArray<E> implements List<E> {
Set<E> toSet() {
return new Set<E>.from(this);
}
+
+ Map<int, E> asMap() {
+ return IterableMixinWorkaround.asMapList(this);
+ }
}
@@ -474,6 +478,10 @@ class _ImmutableArray<E> implements List<E> {
Set<E> toSet() {
return new Set<E>.from(this);
}
+
+ Map<int, E> asMap() {
+ return IterableMixinWorkaround.asMapList(this);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698