Skip to content

Commit e577a58

Browse files
committed
Improve maxOpCount check
1 parent 9fae9d4 commit e577a58

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Sources/TSFFutures/BatchingFutureOperationQueue.swift

+3-4
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,10 @@ public struct LLBBatchingFutureOperationQueue {
148148
}
149149

150150
private static func bridged(maxOpCount: Int) -> Int {
151-
switch maxOpCount {
152-
case OperationQueue.defaultMaxConcurrentOperationCount:
151+
if maxOpCount < 0 {
152+
precondition(maxOpCount == OperationQueue.defaultMaxConcurrentOperationCount)
153153
return System.coreCount
154-
default:
155-
return maxOpCount
156154
}
155+
return maxOpCount
157156
}
158157
}

0 commit comments

Comments
 (0)