mirror of
https://github.com/apple/swift-async-algorithms
synced 2026-11-25 04:27:48 +00:00
instant math for throttle
This commit is contained in:
1 parent
46b3bb088b
commit
aebc7af342
1 file changed
+1
-1
@@ -77,7 +77,7 @@ extension AsyncThrottleSequence: AsyncSequence {
|
||||
return nil
|
||||
}
|
||||
let reduction = await reducing(reduced, element)
|
||||
if clock.now - start >= interval {
|
||||
if start.duration(to: clock.now) >= interval {
|
||||
return reduction
|
||||
} else {
|
||||
reduced = reduction
|
||||
|
||||
Reference in new issue
Block a user