Skip to content

Commit bf0ec24

Browse files
authored
fix iterator variable name on zip (#251)
1 parent 0ebc805 commit bf0ec24

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/AsyncAlgorithms/Zip/ZipStorage.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ final class ZipStorage<Base1: AsyncSequence, Base2: AsyncSequence, Base3: AsyncS
165165
}
166166

167167
group.addTask {
168-
var base1Iterator = base2.makeAsyncIterator()
168+
var base2Iterator = base2.makeAsyncIterator()
169169

170170
while true {
171171
// We are creating a continuation before requesting the next
@@ -188,7 +188,7 @@ final class ZipStorage<Base1: AsyncSequence, Base2: AsyncSequence, Base3: AsyncS
188188
}
189189
}
190190

191-
if let element2 = try await base1Iterator.next() {
191+
if let element2 = try await base2Iterator.next() {
192192
self.stateMachine.withCriticalRegion { stateMachine in
193193
let action = stateMachine.elementProduced((nil, element2, nil))
194194

@@ -226,7 +226,7 @@ final class ZipStorage<Base1: AsyncSequence, Base2: AsyncSequence, Base3: AsyncS
226226

227227
if let base3 = base3 {
228228
group.addTask {
229-
var base1Iterator = base3.makeAsyncIterator()
229+
var base3Iterator = base3.makeAsyncIterator()
230230

231231
while true {
232232
// We are creating a continuation before requesting the next
@@ -249,7 +249,7 @@ final class ZipStorage<Base1: AsyncSequence, Base2: AsyncSequence, Base3: AsyncS
249249
}
250250
}
251251

252-
if let element3 = try await base1Iterator.next() {
252+
if let element3 = try await base3Iterator.next() {
253253
self.stateMachine.withCriticalRegion { stateMachine in
254254
let action = stateMachine.elementProduced((nil, nil, element3))
255255

0 commit comments

Comments
 (0)