MCPcopy Index your code
hub / github.com/google/codesearch / next

Method next

index/write.go:385–400  ·  view source on GitHub ↗

next returns the next entry from the postHeap. It returns a postEntry with trigram == 1<<24 - 1 if h is empty.

()

Source from the content-addressed store, hash-verified

383// next returns the next entry from the postHeap.
384// It returns a postEntry with trigram == 1<<24 - 1 if h is empty.
385func (h *postHeap) next() postEntry {
386 if len(h.ch) == 0 {
387 return makePostEntry(1<<24-1, 0)
388 }
389 ch := h.ch[0]
390 e := ch.e
391 m := ch.m
392 if len(m) == 0 {
393 h.pop()
394 } else {
395 ch.e = m[0]
396 ch.m = m[1:]
397 h.siftDown(0)
398 }
399 return e
400}
401
402func (h *postHeap) pop() *postChunk {
403 ch := h.ch[0]

Callers 2

TestHeapFunction · 0.95
mergePostMethod · 0.95

Calls 3

popMethod · 0.95
siftDownMethod · 0.95
makePostEntryFunction · 0.85

Tested by 1

TestHeapFunction · 0.76