aboutsummaryrefslogtreecommitdiff
path: root/commitquery/reduce.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-28 17:40:02 +0000
committerGravatar Runxi Yu2026-03-28 17:40:02 +0000
commit06583274fa64ad6677773bf4ca54f69226388203 (patch)
tree66354bf972d267bf7ee5135eb7e5b90c31f9fe4d /commitquery/reduce.go
parentformat/commitgraph/read: Lifetime (diff)
signatureNo signature
commitquery: Make a reusable engine thingy
Diffstat (limited to 'commitquery/reduce.go')
-rw-r--r--commitquery/reduce.go6
1 files changed, 3 insertions, 3 deletions
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))