minor: decoratorEwmaUpdate last
Vladimir Bauer
1 year, 10 months ago
| 247 | 247 | result := make(chan *sync.WaitGroup) |
| 248 | 248 | select { |
| 249 | 249 | case b.operateState <- func(s *bState) { |
| 250 | var wg sync.WaitGroup | |
| 251 | s.decoratorEwmaUpdate(current-s.current, iterDur, &wg) | |
| 250 | n := current - s.current | |
| 252 | 251 | s.current = current |
| 253 | 252 | if s.triggerComplete && s.current >= s.total { |
| 254 | 253 | s.current = s.total |
| 255 | 254 | s.triggerCompletion(b) |
| 256 | 255 | } |
| 256 | var wg sync.WaitGroup | |
| 257 | s.decoratorEwmaUpdate(n, iterDur, &wg) | |
| 257 | 258 | result <- &wg |
| 258 | 259 | }: |
| 259 | 260 | wg := <-result |
| 302 | 303 | result := make(chan *sync.WaitGroup) |
| 303 | 304 | select { |
| 304 | 305 | case b.operateState <- func(s *bState) { |
| 305 | var wg sync.WaitGroup | |
| 306 | s.decoratorEwmaUpdate(n, iterDur, &wg) | |
| 307 | 306 | s.current += n |
| 308 | 307 | if s.triggerComplete && s.current >= s.total { |
| 309 | 308 | s.current = s.total |
| 310 | 309 | s.triggerCompletion(b) |
| 311 | 310 | } |
| 311 | var wg sync.WaitGroup | |
| 312 | s.decoratorEwmaUpdate(n, iterDur, &wg) | |
| 312 | 313 | result <- &wg |
| 313 | 314 | }: |
| 314 | 315 | wg := <-result |