@@ -123,10 +123,10 @@ struct AsyncShareSequence<Base: AsyncSequence>: Sendable where Base.Element: Sen
123
123
final class Side {
124
124
// Tracks the state of a single consumer's iteration.
125
125
//
126
- // - `continuaton `: The continuation waiting for the next element (nil if not waiting)
126
+ // - `continuation `: The continuation waiting for the next element (nil if not waiting)
127
127
// - `position`: The consumer's current position in the shared buffer
128
128
struct State {
129
- var continuaton : UnsafeContinuation < Result < Element ? , Failure > , Never > ?
129
+ var continuation : UnsafeContinuation < Result < Element ? , Failure > , Never > ?
130
130
var position = 0
131
131
132
132
// Creates a new state with the position adjusted by the given offset.
@@ -137,7 +137,7 @@ struct AsyncShareSequence<Base: AsyncSequence>: Sendable where Base.Element: Sen
137
137
// - Parameter adjustment: The number of positions to subtract from the current position
138
138
// - Returns: A new `State` with the adjusted position
139
139
func offset( _ adjustment: Int ) -> State {
140
- State ( continuaton : continuaton , position: position - adjustment)
140
+ State ( continuation : continuation , position: position - adjustment)
141
141
}
142
142
}
143
143
@@ -397,7 +397,7 @@ struct AsyncShareSequence<Base: AsyncSequence>: Sendable where Base.Element: Sen
397
397
continuation. resume ( returning: cancelled)
398
398
}
399
399
if let side {
400
- side. continuaton ? . resume ( returning: . success( nil ) )
400
+ side. continuation ? . resume ( returning: . success( nil ) )
401
401
}
402
402
if let iteratingTaskToCancel {
403
403
iteratingTaskToCancel. cancel ( )
@@ -437,7 +437,7 @@ struct AsyncShareSequence<Base: AsyncSequence>: Sendable where Base.Element: Sen
437
437
await withUnsafeContinuation { ( continuation: UnsafeContinuation < Void , Never > ) in
438
438
let hasPendingDemand = state. withLock { state in
439
439
for (_, side) in state. sides {
440
- if side. continuaton != nil {
440
+ if side. continuation != nil {
441
441
return true
442
442
}
443
443
}
@@ -485,13 +485,13 @@ struct AsyncShareSequence<Base: AsyncSequence>: Sendable where Base.Element: Sen
485
485
state. fail ( failure)
486
486
}
487
487
for (id, side) in state. sides {
488
- if let continuation = side. continuaton {
488
+ if let continuation = side. continuation {
489
489
if side. position < state. buffer. count {
490
490
resumptions. append ( Resumption ( continuation: continuation, result: . success( state. buffer [ side. position] ) ) )
491
491
state. sides [ id] ? . position += 1
492
- state. sides [ id] ? . continuaton = nil
492
+ state. sides [ id] ? . continuation = nil
493
493
} else if state. finished {
494
- state. sides [ id] ? . continuaton = nil
494
+ state. sides [ id] ? . continuation = nil
495
495
if let failure = state. failure {
496
496
resumptions. append ( Resumption ( continuation: continuation, result: . failure( failure) ) )
497
497
} else {
@@ -535,7 +535,7 @@ struct AsyncShareSequence<Base: AsyncSequence>: Sendable where Base.Element: Sen
535
535
} else if state. finished {
536
536
return state. emit ( . success( nil ) , limit: limit)
537
537
} else {
538
- state. sides [ id] ? . continuaton = continuation
538
+ state. sides [ id] ? . continuation = continuation
539
539
return state. emit ( nil , limit: limit)
540
540
}
541
541
}
0 commit comments