EwmaIncrInt64: n = 0 is valid case
On timeouts n is going to be 0 and iterDur most probably not.
Let decorator's implementation decide what to do in such case.
Vladimir Bauer
2 years ago
| 304 | 304 | // EwmaIncrInt64 increments progress by amount of n and updates EWMA based |
| 305 | 305 | // decorators by dur of a single iteration. |
| 306 | 306 | func (b *Bar) EwmaIncrInt64(n int64, iterDur time.Duration) { |
| 307 | if n <= 0 { | |
| 308 | return | |
| 309 | } | |
| 310 | 307 | select { |
| 311 | 308 | case b.operateState <- func(s *bState) { |
| 312 | 309 | s.decoratorEwmaUpdate(n, iterDur) |