Commit Graph

2 Commits

Author SHA1 Message Date
Karoy Lorentey
a84ece7a26 [stdlib] Bitset: Eliminate a trap that wasn’t optimized away
Signed/unsigned integer conversions check for unrepresentable values; this wasn’t recognized as impossible, so a trap got compiled into the Dictionary lookup path.

Note to self: next time just use bitwise operations.
2018-09-22 02:04:10 +01:00
Karoy Lorentey
1848b37300 [stdlib] Add bitset constructs
Bitsets implement sorted sets over nonnegative integers up to a predetermined maximum value.

These are intended to replace _UnsafeBitMap. The latter will be removed once its usages are eliminated.

- _UnsafeBitset.Word is the underlying abstraction, implementing a bitset using a single UInt value.
- _UnsafeBitset is a view over a contiguous range of words.
- _Bitset is a COW value type implementing the same construct.
2018-09-22 02:04:04 +01:00