Creates an empty set with preallocated space for at least the specified number of elements.
SDK
- Xcode 6.3+
Framework
- Swift Standard Library
Declaration
init(minimumCapacity: Int)
Parameters
minimumCapacityThe minimum number of elements that the newly created set should be able to store without reallocating its storage buffer.
Discussion
Use this initializer to avoid intermediate reallocations of a set’s storage buffer when you know how many elements you’ll insert into the set after creation.