Skip to content

Commit dc7b4b7

Browse files
authored
Merge pull request swiftlang#1904 from compnerd/double-double
Process: remove some duplication in RunLoop setup
2 parents 851487e + 6ef7919 commit dc7b4b7

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

Foundation/Process.swift

+1-15
Original file line numberDiff line numberDiff line change
@@ -477,21 +477,7 @@ open class Process: NSObject {
477477
hash: nil,
478478
schedule: nil,
479479
cancel: nil,
480-
perform: { emptyRunLoopCallback($0) }
481-
)
482-
483-
var runLoopContext = CFRunLoopSourceContext()
484-
runLoopContext.version = 0
485-
runLoopContext.retain = runLoopSourceRetain
486-
runLoopContext.release = runLoopSourceRelease
487-
runLoopContext.equal = processIsEqual
488-
runLoopContext.perform = emptyRunLoopCallback
489-
self.withUnretainedReference {
490-
(refPtr: UnsafeMutablePointer<UInt8>) in
491-
runLoopContext.info = UnsafeMutableRawPointer(refPtr)
492-
}
493-
self.runLoopSourceContext = runLoopContext
494-
480+
perform: { emptyRunLoopCallback($0) })
495481
self.runLoopSource = CFRunLoopSourceCreate(kCFAllocatorDefault, 0, &runLoopSourceContext!)
496482
CFRunLoopAddSource(CFRunLoopGetCurrent(), runLoopSource, kCFRunLoopDefaultMode)
497483

0 commit comments

Comments
 (0)