Codebase list golang-github-vbauerster-mpb / 4ed749d
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
1 changed file(s) with 0 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
304304 // EwmaIncrInt64 increments progress by amount of n and updates EWMA based
305305 // decorators by dur of a single iteration.
306306 func (b *Bar) EwmaIncrInt64(n int64, iterDur time.Duration) {
307 if n <= 0 {
308 return
309 }
310307 select {
311308 case b.operateState <- func(s *bState) {
312309 s.decoratorEwmaUpdate(n, iterDur)