mirror of
https://github.com/apple/swift-collections
synced 2026-11-25 04:37:48 +00:00
[BitArray] Fix logic error in toggleAll()
D’oh — lucky the test coverage caught this; unlucky that the test wasn’t deterministic, and the chances of this occurring were quite low.
This commit is contained in:
2 files changed
+2
-1
No files matched your search
@@ -166,6 +166,7 @@ extension BitArray {
|
||||
|
||||
public mutating func toggleAll(in range: Range<Int>) {
|
||||
precondition(range.upperBound <= count, "Range out of bounds")
|
||||
guard !range.isEmpty else { return }
|
||||
_update { handle in
|
||||
let words = handle._mutableWords
|
||||
let start = _BitPosition(range.lowerBound)
|
||||
|
||||
Reference in new issue
Block a user