Reuse complete glossary selections across matching stages

This commit is contained in:
2026-11-17 04:26:44 +00:00
parent d26991f0bf
commit 743e64a07a
4 changed files with 39 additions and 14 deletions

View File

@@ -150,21 +150,13 @@ func ProcessingPlan(ctx context.Context, cfg *config.Config, inspectProfile func
}
}
specs := contracts.ResolveModuleRunSpecs(cfg)
type glossarySelection struct {
context, protected string
exempt bool
}
glossaryViews := make(map[glossarySelection]int)
glossaryViews := make(map[contracts.GlossarySelectionKey]int)
for i := range specs {
if err := ctx.Err(); err != nil {
return nil, err
}
spec := &specs[i]
key := glossarySelection{
context: fmt.Sprintf("%q", spec.Settings.Glossaries),
protected: fmt.Sprintf("%q", spec.Settings.ProtectedTerms),
exempt: spec.ModuleKey == modulecatalog.KeyGlossary,
}
key := contracts.GlossarySelection(spec.Settings)
if prior, ok := glossaryViews[key]; ok {
spec.GlossaryVariables = specs[prior].GlossaryVariables
spec.GlossaryView = specs[prior].GlossaryView