Codebase list golang-github-vbauerster-mpb / ad79a03
short var name Vladimir Bauer 4 years ago
1 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
257257 }
258258
259259 func (s *pState) flush(cw *cwriter.Writer) error {
260 var totalLines int
260 var lines int
261261 pool := make([]*Bar, 0, s.bHeap.Len())
262262 for s.bHeap.Len() > 0 {
263263 b := heap.Pop(&s.bHeap).(*Bar)
264264 frame := <-b.frameCh
265 totalLines += frame.lines
265 lines += frame.lines
266266 _, err := cw.ReadFrom(frame.reader)
267267 if err != nil {
268268 return err
277277 pool = append(pool, qb)
278278 toDrop = true
279279 } else if s.popCompleted && !b.bs.noPop {
280 totalLines -= frame.lines
280 lines -= frame.lines
281281 toDrop = true
282282 }
283283 if toDrop || b.bs.dropOnComplete {
292292 heap.Push(&s.bHeap, b)
293293 }
294294
295 return cw.Flush(totalLines)
295 return cw.Flush(lines)
296296 }
297297
298298 func (s *pState) newTicker(done <-chan struct{}) chan time.Time {