[PersistentSet] Flesh out isSubset/iSuperset/isDisjoint/etc overloads (untested)

This adds an experimental _FastMembershipCheckable protocol to speed
up these relationship predicates when possible — having separate
overloads for each known collection with a fast containment check
is not going to scale for long.

This commit also introduces a set of isEqual(to:) methods that
generalize ==.
This commit is contained in:
Karoy Lorentey committed 2022-09-24 17:02:16 -07:00
1 parent 00ae83df1e
commit 3d10964905
11 files changed
+223 -10

No files matched your search

@@ -9,6 +9,10 @@
//
//===----------------------------------------------------------------------===//
import _CollectionsUtilities
extension BitSet: _FastMembershipCheckable {}
extension BitSet {
/// Creates a new empty bit set with enough storage capacity to store values
/// up to the given maximum value without reallocating storage.