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.
()
| 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. |
| 74 | func (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. |
| 83 | func (h *commitNodeHeap) Size() int { |