-// nextLeaf returns the oldest leaf in the window that can start.
-func (q *BuildQueue) nextLeaf() (NodeKey, bool) {
- for _, id := range q.leaves[:min(len(q.leaves), buildLeafWindow)] {
- key := NodeKey{0, id}
- if !q.running[key] && !q.failed[key] {
- return key, true
- }
- }
-
- return NodeKey{}, false
-}
-
-// BuildMergeHeap holds the merges that can start, by the end of their context.
-type BuildMergeHeap []NodeKey
-