MCPcopy Create free account
hub / github.com/go-git/go-git / Pop

Method Pop

blame.go:519–526  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

517func (pq *priorityQueueImp) Swap(i, j int) { (*pq)[i], (*pq)[j] = (*pq)[j], (*pq)[i] }
518func (pq *priorityQueueImp) Push(x any) { *pq = append(*pq, x.(*queueItem)) }
519func (pq *priorityQueueImp) Pop() any {
520 n := len(*pq)
521 ret := (*pq)[n-1]
522 (*pq)[n-1] = nil // ovoid memory leak
523 *pq = (*pq)[0 : n-1]
524
525 return ret
526}
527func (pq *priorityQueueImp) Peek() *object.Commit {
528 if len(*pq) == 0 {
529 return nil

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected