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

Unified Diff: sdk/lib/collection/linked_hash_set.dart

Issue 12391010: Make HashSet.length constant time. (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/collection/linked_hash_set.dart
diff --git a/sdk/lib/collection/linked_hash_set.dart b/sdk/lib/collection/linked_hash_set.dart
index e72493aad57173be1f21d833f0fa395d68b88a95..7fc0653b22751e170c38caba8703b2e4204eba85 100644
--- a/sdk/lib/collection/linked_hash_set.dart
+++ b/sdk/lib/collection/linked_hash_set.dart
@@ -30,6 +30,8 @@ class LinkedHashSet<E> extends Collection<E> implements Set<E> {
}
}
+ int get length => _table._elementCount;
+
bool get isEmpty => _table._elementCount == 0;
bool contains(Object object) => _table._get(object) >= 0;

Powered by Google App Engine
This is Rietveld 408576698