Skip to content

Commit b5462d1

Browse files
committed
Make return type of dispatch_semaphore_create non-optional
1 parent f85f987 commit b5462d1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/swift/Dispatch.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,8 @@ public func dispatch_group_leave(group:dispatch_group_t) -> Void {
433433
// semaphore.h
434434
//////////
435435

436-
public func dispatch_semaphore_create(value:Int) -> dispatch_semaphore_t? {
437-
let csem = CDispatch.dispatch_semaphore_create(value)
438-
return csem != nil ? dispatch_semaphore_t(csem) : nil
436+
public func dispatch_semaphore_create(value:Int) -> dispatch_semaphore_t {
437+
return dispatch_semaphore_t(CDispatch.dispatch_semaphore_create(value))
439438
}
440439

441440
public func dispatch_semaphore_wait(dsema:dispatch_semaphore_t, _ timeout:dispatch_time_t) -> Int {

0 commit comments

Comments
 (0)