MCPcopy
hub / github.com/lindb/lindb / initQueue

Method initQueue

kv/table/iterator.go:61–77  ·  view source on GitHub ↗

initQueue initializes the priority queue

()

Source from the content-addressed store, hash-verified

59
60// initQueue initializes the priority queue
61func (m *mergedIterator) initQueue() {
62 i := 0
63 for _, it := range m.its {
64 if it.HasNext() {
65 m.pq = append(m.pq, &item{
66 it: it,
67 key: it.Key(),
68 value: it.Value(),
69 index: i,
70 })
71 i++
72 }
73 }
74 if len(m.pq) > 0 {
75 heap.Init(&m.pq)
76 }
77}
78
79// HasNext returns if the iteration has more element.
80// It returns false if the iterator is exhausted.

Callers 1

NewMergedIteratorFunction · 0.95

Calls 4

HasNextMethod · 0.65
KeyMethod · 0.65
ValueMethod · 0.65
InitMethod · 0.65

Tested by

no test coverage detected