Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple extension to init an array and reserve an initial capacity
extension Array where Element: Equatable {
/**
* Will init the array and reserve an initial capacity.
*/
init(withReservedCapacity rc: Int) {
self.init()
self.reserveCapacity(rc)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.