mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
12 lines
233 B
Swift
12 lines
233 B
Swift
#if !swift(>=4.1)
|
|
|
|
extension Sequence {
|
|
func compactMap<ElementOfResult>(
|
|
_ transform: (Self.Element
|
|
) throws -> ElementOfResult?) rethrows -> [ElementOfResult] {
|
|
return try flatMap(transform)
|
|
}
|
|
}
|
|
|
|
#endif
|