[Dispatch][gardening] Use Optional.map over flatMap where appropriate

The initializers used here are not optional ones, so there is no need to use `flatMap`.
This commit is contained in:
Sho Ikeda
2018-03-10 23:07:57 +09:00
parent 3eecb49c55
commit 1c3909e03d
2 changed files with 5 additions and 5 deletions

View File

@@ -344,8 +344,8 @@ public extension DispatchQueue {
public func setSpecific<T>(key: DispatchSpecificKey<T>, value: T?) {
let k = Unmanaged.passUnretained(key).toOpaque()
let v = value.flatMap { _DispatchSpecificValue(value: $0) }
let p = v.flatMap { Unmanaged.passRetained($0).toOpaque() }
let v = value.map { _DispatchSpecificValue(value: $0) }
let p = v.map { Unmanaged.passRetained($0).toOpaque() }
__dispatch_queue_set_specific(self, k, p, _destructDispatchSpecificValue)
}
}