Created
June 4, 2018 14:34
-
-
Save Briahas/82d7bfcaca12b34e932f8b939d968ba8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Array where Element: Equatable { | |
mutating func delete(_ element: Element) { | |
self = self.filter { $0 != element } | |
} | |
mutating func removeObject<T>(_ element: T) where T : Equatable { | |
self = self.filter {$0 as? T != element} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment