mirror of
https://github.com/apple/swift-collections
synced 2026-11-28 05:04:21 +00:00
[BitCollections] BitArray.insert(repeating:count:at:): Fix bogus precondition
This commit is contained in:
1 file changed
+1
-1
@@ -38,7 +38,7 @@ extension BitArray {
|
||||
at index: Int
|
||||
) {
|
||||
precondition(count >= 0, "Cannot add a negative number of items")
|
||||
precondition(index >= 0 && index <= count, "Index out of bounds")
|
||||
precondition(index >= 0 && index <= self.count, "Index out of bounds")
|
||||
guard count > 0 else { return }
|
||||
_extend(by: count, with: false)
|
||||
_copy(from: index ..< self.count - count, to: index + count)
|
||||
|
||||
Reference in new issue
Block a user