From 3fdec79ddcafde9848b60fc420bb9222a4786e1f Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 29 Mar 2026 14:07:17 +0000 Subject: commitquery: Use internal/heap for the priority queue --- commitquery/node_paint_down_to_common.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'commitquery/node_paint_down_to_common.go') 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 { -- cgit v1.3.1-10-gc9f91