`BitSet[members:]` resolved range expressions against
`Int.min ..< Int.max`. A closed range ending at `Int.max`
(`bits[members: ...Int.max]`, `bits[members: 0 ... Int.max]`) needs the
index after `Int.max`, so it trapped with "Index out of bounds", while
`..<Int.max` and `0...` worked.
Resolve against a small internal collection of all `Int` values whose
`index(after:)` saturates at `Int.max`. `Int.max` can never be a bit set
member, so `lower ... Int.max` resolving to `lower ..< Int.max` doesn't
change which members are selected. `BitSet.Counted[members:]` forwards
to `BitSet`, so it's fixed too.
DocC keeps changing its link syntax. The latest iteration appears to have trouble dealing with `Self`-taking or `Self`-returning methods, so change our API to replace `Self` with a direct mention of the concrete type. ¯\\\_(ツ)\_/¯
That said, the new compiler also found a large number of mismatching parameter names, and that was really helpful.
The indexes passed to span(after:) and friends on UniqueArray
and RigidArray are modified before return. This adds notes
about the updated values to the method documentation, along
with a few other minor formatting changes (dropping smart
quotes, single-sentence abstracts).
We are forced to do this due to an Xcode issue (#364) with underscored module names.
This module remains unstable, despite the removal of the underscore. Directly importing it from outside the package remains unsupported. This module and/or its entire contents may go away or change in incompatible ways in any future swift-collections release.
These marker-like protocols will allow certain
generic operations to get a performance boost
if the passed-in value happens to be guaranteed
to contain unique elements or to be sorted.
Also, review API checker protocols for Sets and
sorted collections and adjust things as needed.
BitSet gains custom implementations for min()
and max() as part of these improvements.
We don’t actually need this, as `_customContainsEquatableElement`
returning non-nil is a perfectly suitable indication that containment
checking is fast.
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 results in a significant speedup for both individual
insert/remove operations as well as bulk set operations -
up to 4x.
Use cases that require an O(1) count can use the separate
BitSet.Counted type.