Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if swift(>=4.1)
- #else
- extension Collection {
- func compactMap<ElementOfResult>(
- _ transform: (Element) throws -> ElementOfResult?
- ) rethrows -> [ElementOfResult] {
- return try flatMap(transform)
- }
- }
- #endif
Add Comment
Please, Sign In to add comment