Avoid copying unused resolution history

This commit is contained in:
2026-09-12 13:51:04 +00:00
parent 715364b079
commit 28e7fc5f69
3 changed files with 89 additions and 3 deletions

View File

@@ -15,8 +15,13 @@ type resolutionInput struct {
}
func newResolutionInput(metadata Metadata, final *document.Node, sources []SourceInfo) resolutionInput {
frozen := cloneMetadata(metadata)
frozen.effectivePaths = effectivePathIndex(final)
frozen := Metadata{
fields: make(map[string]FieldInfo, len(metadata.fields)),
effectivePaths: effectivePathIndex(final),
}
for pointer, info := range metadata.fields {
frozen.fields[pointer] = cloneFieldInfo(info)
}
indexed := make(map[string]SourceInfo, len(sources))
for _, source := range sources {
if source.ID == "" {