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

Method Pop

plumbing/object/commitgraph/commitnode_walker_helper.go:64–70  ·  view source on GitHub ↗

Pop removes top element on heap and returns it, or nil if heap is empty. Second return parameter is true, unless the heap was empty and there was nothing to pop.

()

Source from the content-addressed store, hash-verified

62// Pop removes top element on heap and returns it, or nil if heap is empty.
63// Second return parameter is true, unless the heap was empty and there was nothing to pop.
64func (h *commitNodeHeap) Pop() (CommitNode, bool) {
65 c, ok := h.Heap.Pop()
66 if !ok {
67 return nil, false
68 }
69 return c.(CommitNode), true
70}
71
72// Peek returns top element on the heap without removing it, or nil if heap is empty.
73// Second return parameter is true, unless the heap was empty and there was nothing to peek.

Callers

nothing calls this directly

Calls 1

PopMethod · 0.65

Tested by

no test coverage detected