diff options
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 { |
