Skip to content

Commit

Permalink
Remove redundant check in throttle(while:on:)
Browse files Browse the repository at this point in the history
When `shouldThrottle.producer` is started, the observer will be executed
synchronously first time. This makes the initial check redundant,
because the value will be updated as soon as `shouldThrottle` is
observed.
  • Loading branch information
sharplet committed Nov 16, 2016
1 parent 4c75001 commit f757e53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Signal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@ extension SignalProtocol {
where P.Value == Bool
{
return Signal { observer in
let initial: ThrottleWhileState<Value> = shouldThrottle.value ? .throttled(nil) : .resumed
let initial: ThrottleWhileState<Value> = .resumed
let state = Atomic(initial)
let schedulerDisposable = SerialDisposable()

Expand Down

0 comments on commit f757e53

Please sign in to comment.