minor: var refactoring
Vladimir Bauer
3 years ago
| 288 | 288 | rows := make([]io.Reader, 0, height) |
| 289 | 289 | pool := make([]*Bar, 0, s.bHeap.Len()) |
| 290 | 290 | for s.bHeap.Len() > 0 { |
| 291 | var frameRowsUsed int | |
| 291 | var usedRows int | |
| 292 | 292 | b := heap.Pop(&s.bHeap).(*Bar) |
| 293 | 293 | frame := <-b.frameCh |
| 294 | 294 | for i := len(frame.rows) - 1; i >= 0; i-- { |
| 295 | 295 | if len(rows) < height { |
| 296 | 296 | rows = append(rows, frame.rows[i]) |
| 297 | frameRowsUsed++ | |
| 297 | usedRows++ | |
| 298 | 298 | } else { |
| 299 | 299 | wg.Add(1) |
| 300 | 300 | go func(discardRow io.Reader) { |
| 313 | 313 | drop = true |
| 314 | 314 | } else if s.popCompleted && !b.bs.noPop { |
| 315 | 315 | if frame.shutdown > 1 { |
| 316 | popCount += frameRowsUsed | |
| 316 | popCount += usedRows | |
| 317 | 317 | drop = true |
| 318 | 318 | } else { |
| 319 | 319 | s.popPriority++ |