mirror of
https://github.com/apple/swift-collections
synced 2026-11-25 04:37:48 +00:00
[BitArray] Add init(minimumCapacity:)
This commit is contained in:
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user