Adjust random logic for dispatch queue

This commit is contained in:
Daniel Saidi 2022-09-01 16:10:33 +02:00
parent 12ce18a036
commit 8e0dc7e858
2 changed files with 3 additions and 2 deletions

View File

@ -11,7 +11,8 @@ This version adjusts the library for Xcode 14 and deprecates some things.
### 💡 Behavior changes
* The library no longer uses the DocC package plugin.
* The library no longer uses the DocC package plugin.
* `DispatchQueue+Throttle` now uses `Double.random(in:)` instead of `arc4random()`.
### 🗑 Deprecations

View File

@ -9,7 +9,7 @@
import Foundation
private var lastDebounceCallTimes = [AnyHashable: DispatchTime]()
private let nilContext: AnyHashable = arc4random()
private let nilContext: AnyHashable = Int.random(in: 0...100_000)
private var throttleWorkItems = [AnyHashable: DispatchWorkItem]()
public extension DispatchQueue {