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

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

Issue 26681002: Add EfficientLength marker interface to some iterabels. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Also document Map.length is efficient, while we are at it. Created 7 years, 2 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/iterable.dart ('k') | sdk/lib/core/map.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 868e9537175a276e7f36dbc6462e8277e8176cf0..eca42d828a4a888a4b6102668d33ce88a0ad5d19 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -36,7 +36,7 @@ part of dart.core;
* temporarily and is restored before continuing the iteration, the iterator
* does not detect it.
*/
-abstract class List<E> implements Iterable<E> {
+abstract class List<E> implements Iterable<E>, EfficientLength {
/**
* Creates a list of the given length.
*
@@ -128,6 +128,9 @@ abstract class List<E> implements Iterable<E> {
* Returns the number of objects in this list.
*
* The valid indices for a list are `0` through `length - 1`.
+ *
+ * This operations is efficient, and does not require iterating and counting
+ * the elements.
*/
int get length;
« no previous file with comments | « sdk/lib/core/iterable.dart ('k') | sdk/lib/core/map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698