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

Unified Diff: sdk/lib/collection/splay_tree.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/collection/queue.dart ('k') | sdk/lib/core/iterable.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/collection/splay_tree.dart
diff --git a/sdk/lib/collection/splay_tree.dart b/sdk/lib/collection/splay_tree.dart
index 72251d940b518ffe7bcc9e6a873854317a28e7d2..eab9fb86df8dcbb0fb987dbae535f4f03383d3fe 100644
--- a/sdk/lib/collection/splay_tree.dart
+++ b/sdk/lib/collection/splay_tree.dart
@@ -571,7 +571,8 @@ abstract class _SplayTreeIterator<T> implements Iterator<T> {
T _getValue(_SplayTreeNode node);
}
-class _SplayTreeKeyIterable<K> extends IterableBase<K> {
+class _SplayTreeKeyIterable<K> extends IterableBase<K>
+ implements EfficientLength {
_SplayTree<K> _tree;
_SplayTreeKeyIterable(this._tree);
int get length => _tree._count;
@@ -579,7 +580,8 @@ class _SplayTreeKeyIterable<K> extends IterableBase<K> {
Iterator<K> get iterator => new _SplayTreeKeyIterator<K>(_tree);
}
-class _SplayTreeValueIterable<K, V> extends IterableBase<V> {
+class _SplayTreeValueIterable<K, V> extends IterableBase<V>
+ implements EfficientLength {
SplayTreeMap<K, V> _map;
_SplayTreeValueIterable(this._map);
int get length => _map._count;
« no previous file with comments | « sdk/lib/collection/queue.dart ('k') | sdk/lib/core/iterable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698