Skip to content

Commit

Permalink
Remove Demand.assertValid check
Browse files Browse the repository at this point in the history
The check is already included by using numericCast in compare method
  • Loading branch information
Kyle-Ye committed Dec 21, 2023
1 parent 0f1cf5e commit 212f1ed
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
9 changes: 1 addition & 8 deletions Sources/OpenCombine/Helpers/Violations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ extension Subscribers.Demand {
@_transparent
@inline(__always)
internal func assertNonZero() {
precondition(rawValue <= Subscribers.Demand.unlimited.rawValue)
precondition(rawValue > Subscribers.Demand.none.rawValue)
}

@_transparent
@inline(__always)
internal func assertValid() {
precondition(rawValue <= Subscribers.Demand.unlimited.rawValue)
precondition(rawValue != .zero)
}
}
1 change: 0 additions & 1 deletion Sources/OpenCombine/Publishers/Publishers.Zip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,6 @@ private class AbstractZip<Input, Failure, Downstream> where Downstream: Subscrib
let demand = pendingDemand
pendingDemand = .none
lock.unlock()
demand.assertValid()
guard demand != .none, !subscriptions.isEmpty else {
return
}
Expand Down

0 comments on commit 212f1ed

Please sign in to comment.