From ed1d2a04cfa3dd328aefd52792808ec2ec623cf2 Mon Sep 17 00:00:00 2001 From: Kevin Perry Date: Mon, 14 Mar 2022 14:06:13 -0700 Subject: [PATCH] Fixed simple mistake from pr/buffer --- Sources/AsyncAlgorithms/AsyncBufferSequence.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/AsyncAlgorithms/AsyncBufferSequence.swift b/Sources/AsyncAlgorithms/AsyncBufferSequence.swift index b20d21e..d6fb27e 100644 --- a/Sources/AsyncAlgorithms/AsyncBufferSequence.swift +++ b/Sources/AsyncAlgorithms/AsyncBufferSequence.swift @@ -78,8 +78,9 @@ actor AsyncBufferState { func terminate() { terminationState = .terminal + var oldPending = pending pending = [] - for continuation in pending { + for continuation in oldPending { continuation.resume(returning: .success(nil)) } }