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

Unified Diff: sdk/lib/core/map.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/list.dart ('k') | sdk/lib/core/set.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/map.dart
diff --git a/sdk/lib/core/map.dart b/sdk/lib/core/map.dart
index 38cb7cf3bf5e0a947ad659543a2d7ae3585f325e..eb6c6769ce8f18cdceba0133cbdf5d8298003844 100644
--- a/sdk/lib/core/map.dart
+++ b/sdk/lib/core/map.dart
@@ -153,16 +153,28 @@ abstract class Map<K, V> {
/**
* The keys of [this].
+ *
+ * The `contains` method of the returned iterable is as efficient as
+ * [containsKey].
+ *
+ * The returned iterable is guaranteed to have the same `length` as this map,
+ * and its `length` getter is efficient.
*/
Iterable<K> get keys;
/**
* The values of [this].
+ *
+ * This iterable is guaranteed to have the same `length` as this map,
+ * and its `length` getter is efficient.
*/
Iterable<V> get values;
/**
* The number of {key, value} pairs in the map.
+ *
+ * This operation is efficient, and doesn't require iterating and counting
+ * the entries.
*/
int get length;
« no previous file with comments | « sdk/lib/core/list.dart ('k') | sdk/lib/core/set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698