Skip to content

Commit e40a6be

Browse files
M0rtyMerrfreak4pc
authored andcommitted
Change unwrap impl to use compactMap
1 parent 8070bcb commit e40a6be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/RxSwift/unwrap.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ extension ObservableType {
1818
*/
1919

2020
public func unwrap<T>() -> Observable<T> where Element == T? {
21-
return self.filter { $0 != nil }.map { $0! }
21+
return self.compactMap { $0 }
2222
}
2323
}

0 commit comments

Comments
 (0)