From 06583274fa64ad6677773bf4ca54f69226388203 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 28 Mar 2026 17:40:02 +0000 Subject: commitquery: Make a reusable engine thingy --- commitquery/reduce.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'commitquery/reduce.go') diff --git a/commitquery/reduce.go b/commitquery/reduce.go index ac85d619..f8a86f69 100644 --- a/commitquery/reduce.go +++ b/commitquery/reduce.go @@ -5,7 +5,7 @@ import ( ) // removeRedundant removes redundant merge-base candidates. -func removeRedundant(query *Query, candidates []nodeIndex) ([]nodeIndex, error) { +func removeRedundant(query *query, candidates []nodeIndex) ([]nodeIndex, error) { for _, idx := range candidates { if query.effectiveGeneration(idx) != generationInfinity { return removeRedundantWithGen(query, candidates), nil @@ -15,7 +15,7 @@ func removeRedundant(query *Query, candidates []nodeIndex) ([]nodeIndex, error) return removeRedundantNoGen(query, candidates) } -func removeRedundantNoGen(query *Query, candidates []nodeIndex) ([]nodeIndex, error) { +func removeRedundantNoGen(query *query, candidates []nodeIndex) ([]nodeIndex, error) { redundant := make([]bool, len(candidates)) work := make([]nodeIndex, 0, len(candidates)-1) filledIndex := make([]int, 0, len(candidates)-1) @@ -72,7 +72,7 @@ func removeRedundantNoGen(query *Query, candidates []nodeIndex) ([]nodeIndex, er return out, nil } -func removeRedundantWithGen(query *Query, candidates []nodeIndex) []nodeIndex { +func removeRedundantWithGen(query *query, candidates []nodeIndex) []nodeIndex { sorted := append([]nodeIndex(nil), candidates...) slices.SortFunc(sorted, compareByGeneration(query)) -- cgit v1.3.1-10-gc9f91