File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -91,20 +91,19 @@ public final class AsyncCurrentValueSubject<Element>: AsyncSubject where Element
9191 func handleNewConsumer( ) -> ( iterator: AsyncBufferedChannel < Element > . Iterator , unregister: @Sendable ( ) -> Void ) {
9292 let asyncBufferedChannel = AsyncBufferedChannel < Element > ( )
9393
94- let ( terminalState, current ) = self . state. withCriticalRegion { state -> ( Termination ? , Element ) in
95- ( state. terminalState, state . current )
94+ let terminalState = self . state. withCriticalRegion { state -> Termination ? in
95+ state. terminalState
9696 }
9797
9898 if let terminalState = terminalState, terminalState. isFinished {
9999 asyncBufferedChannel. finish ( )
100100 return ( asyncBufferedChannel. makeAsyncIterator ( ) , { } )
101101 }
102102
103- asyncBufferedChannel. send ( current)
104-
105103 let consumerId = self . state. withCriticalRegion { state -> Int in
106104 state. ids += 1
107105 state. channels [ state. ids] = asyncBufferedChannel
106+ asyncBufferedChannel. send ( state. current)
108107 return state. ids
109108 }
110109
You can’t perform that action at this time.
0 commit comments