Codebase list golang-github-vbauerster-mpb / d46983a
reuse rows slice Vladimir Bauer 3 years ago
1 changed file(s) with 3 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
3939 heapUpdated bool
4040 pMatrix map[int][]chan int
4141 aMatrix map[int][]chan int
42 rows []io.Reader
4243
4344 // following are provided/overrided by user
4445 idCount int
6869 func NewWithContext(ctx context.Context, options ...ContainerOption) *Progress {
6970 s := &pState{
7071 bHeap: priorityQueue{},
72 rows: make([]io.Reader, 128),
7173 rr: prr,
7274 queueBars: make(map[*Bar]*Bar),
7375 output: os.Stdout,
285287 func (s *pState) flush(cw *cwriter.Writer, height int) error {
286288 var wg sync.WaitGroup
287289 var popCount int
288 rows := make([]io.Reader, 0, height)
290 rows := s.rows[:0]
289291 for s.bHeap.Len() > 0 {
290292 var usedRows int
291293 b := heap.Pop(&s.bHeap).(*Bar)