diff --git a/Sources/BitCollections/BitArray/BitArray+Extras.swift b/Sources/BitCollections/BitArray/BitArray+Extras.swift index d9a72e4d..3c5de281 100644 --- a/Sources/BitCollections/BitArray/BitArray+Extras.swift +++ b/Sources/BitCollections/BitArray/BitArray+Extras.swift @@ -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)