diff options
| author | 2026-03-29 14:07:17 +0000 | |
|---|---|---|
| committer | 2026-03-29 14:07:17 +0000 | |
| commit | 3fdec79ddcafde9848b60fc420bb9222a4786e1f (patch) | |
| tree | e3aab1efe7576d8b8ffb8afc9e7c1122d57e431d /commitquery/node_paint_down_to_common.go | |
| parent | internal/heap: Much more reasonable binary heap (diff) | |
| signature | No signature | |
commitquery: Use internal/heap for the priority queue
Diffstat (limited to 'commitquery/node_paint_down_to_common.go')
| -rw-r--r-- | commitquery/node_paint_down_to_common.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/commitquery/node_paint_down_to_common.go b/commitquery/node_paint_down_to_common.go index 6bb1f489..a9618c2d 100644 --- a/commitquery/node_paint_down_to_common.go +++ b/commitquery/node_paint_down_to_common.go @@ -21,8 +21,15 @@ func (query *query) paintDownToCommon(left nodeIndex, rights []nodeIndex, minGen lastGeneration := generationInfinity - for query.queueHasNonStale(queue) { - idx := queue.PopNode() + for queue.Len() > 0 { + idx, ok := queue.PopNode() + if !ok { + break + } + + if query.hasAnyMarks(idx, markStale) { + continue + } generation := query.effectiveGeneration(idx) if generation > lastGeneration { |
