... to work around some of the "unexpected EOF" failures.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2023-02-09 20:21:50 +01:00
parent e9f30e5b65
commit 643a2359e4
294 changed files with 6816 additions and 4797 deletions

33
vendor/github.com/vbauerster/mpb/v8/priority_queue.go generated vendored Normal file
View File

@@ -0,0 +1,33 @@
package mpb
// A priorityQueue implements heap.Interface
type priorityQueue []*Bar
func (pq priorityQueue) Len() int { return len(pq) }
func (pq priorityQueue) Less(i, j int) bool {
// less priority pops first
return pq[i].priority > pq[j].priority
}
func (pq priorityQueue) Swap(i, j int) {
pq[i], pq[j] = pq[j], pq[i]
pq[i].index = i
pq[j].index = j
}
func (pq *priorityQueue) Push(x interface{}) {
s := *pq
bar := x.(*Bar)
bar.index = len(s)
s = append(s, bar)
*pq = s
}
func (pq *priorityQueue) Pop() interface{} {
s := *pq
*pq = s[0 : len(s)-1]
bar := s[len(s)-1]
bar.index = -1 // for safety
return bar
}