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

Method Peek

plumbing/object/commitgraph/commitnode_walker_helper.go:74–80  ·  view source on GitHub ↗

Peek returns top element on the heap without removing it, or nil if heap is empty. Second return parameter is true, unless the heap was empty and there was nothing to peek.

()

Source from the content-addressed store, hash-verified

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.
74func (h *commitNodeHeap) Peek() (CommitNode, bool) {
75 c, ok := h.Heap.Peek()
76 if !ok {
77 return nil, false
78 }
79 return c.(CommitNode), true
80}
81
82// Size returns number of elements within the heap.
83func (h *commitNodeHeap) Size() int {

Callers

nothing calls this directly

Calls 1

PeekMethod · 0.65

Tested by

no test coverage detected