[BitArray] Add init(minimumCapacity:)

This commit is contained in:
Karoy Lorentey committed 2023-01-31 17:43:06 -08:00
1 parent 4281dc4482
commit c15e484f5a
1 file changed
+8
@@ -26,4 +26,12 @@ extension BitArray {
let count = value.bitWidth
self.init(_storage: words, count: count)
}
/// Creates a new, empty bit array with preallocated space for at least the
/// specified number of elements.
public init(minimumCapacity: Int) {
self.init()
reserveCapacity(minimumCapacity)
}
}
}