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

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

Issue 61733013: Add SplayTreeSet. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added more tests Created 7 years, 1 month 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 | « no previous file | sdk/lib/collection/splay_tree.dart » ('j') | sdk/lib/collection/splay_tree.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/collection/hash_set.dart
diff --git a/sdk/lib/collection/hash_set.dart b/sdk/lib/collection/hash_set.dart
index 74a25d502d94e81e1fa80d88176e8f43d28ed4b2..10d74ba5472e0fc8aa6d1640fb513018ef21b9c7 100644
--- a/sdk/lib/collection/hash_set.dart
+++ b/sdk/lib/collection/hash_set.dart
@@ -20,14 +20,8 @@ abstract class _HashSetBase<E> extends IterableBase<E> implements Set<E> {
Set<E> intersection(Set<Object> other) {
Set<E> result = _newSet();
- if (other.length < this.length) {
- for (var element in other) {
- if (this.contains(element)) result.add(element);
- }
- } else {
- for (E element in this) {
- if (other.contains(element)) result.add(element);
- }
+ for (var element in this) {
+ if (other.contains(element)) result.add(element);
}
return result;
}
« no previous file with comments | « no previous file | sdk/lib/collection/splay_tree.dart » ('j') | sdk/lib/collection/splay_tree.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698