Merge pull request #682 from lorentey/container-updates

[ContainersPreview] Update Container protocols
This commit is contained in:
Karoy Lorentey authored and GitHub committed 2026-07-22 13:08:25 -07:00
commit 8380ca41da
152 files changed
+5790 -2272

No files matched your search

@@ -87,15 +87,15 @@ internal struct _ChunkedBitsBackwardIterator {
extension IteratorProtocol where Element == Bool {
mutating func _nextChunk(
maximumCount: UInt = _Word._capacity
maxCount: UInt = _Word._capacity
) -> (bits: _Word, count: UInt) {
assert(maximumCount <= _Word.capacity)
assert(maxCount <= _Word.capacity)
var bits = _Word.empty
var c: UInt = 0
while let v = next() {
if v { bits.insert(c) }
c += 1
if c == maximumCount { break }
if c == maxCount { break }
}
return (bits, c)
}
@@ -162,7 +162,7 @@ extension BitArray._UnsafeHandle {
var it = source.makeIterator()
if pos.bit > 0 {
let (bits, count) = it._nextChunk(
maximumCount: _Word._capacity - pos.bit)
maxCount: _Word._capacity - pos.bit)
_copy(bits: bits, count: count, to: pos)
pos.value += count
}
@@ -285,7 +285,7 @@ extension BitArray {
var pos = _BitPosition(_count)
if pos.bit > 0 {
let (bits, count) = it._nextChunk(
maximumCount: _Word._capacity - pos.bit)
maxCount: _Word._capacity - pos.bit)
guard count > 0 else { return }
_count += count
_update { $0._copy(bits: bits, count: count, to: pos) }