Skip to content

Instantly share code, notes, and snippets.

View curzel-it's full-sized avatar

Federico Curzel curzel-it

View GitHub Profile
@curzel-it
curzel-it / Array+ReserveCapacity.swift
Created June 12, 2017 22:25
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)
}
}