Remove unused history document copies

This commit is contained in:
2026-10-25 21:47:53 +00:00
parent 0f9ecf12ed
commit 119b42c810
6 changed files with 14 additions and 13 deletions

View File

@@ -109,14 +109,13 @@ func publishLoadResult[T any](schema *schemaDescriptor, definition Definition[T]
}
decoded, metadata := resolved.decoded, resolved.metadata
final, applications, resolutionSnapshots := resolved.final, resolved.applications, resolved.snapshots
structuralInput := document.Clone(resolved.structuralInput)
preCLI := document.Clone(resolved.preCLI)
allApplications := append(cloneHistoryApplications(applications), cloneHistoryApplications(resolved.postDecodeApps)...)
finalizeMetadataPaths(&metadata, final, allApplications, decoded.baseline, resolved.structuralInput, resolved.preCLI, decoded.final)
secrets := classifySecretPathsWithEvidence(schema, definition.Secret, metadata, final, allApplications, resolved.versionEvidence, decoded.baseline, resolved.structuralInput, resolved.preCLI, decoded.final)
sources := sourceInfosWithVersionEvidence(accumulator.sources, resolved.versionEvidence, secrets, false)
retainedTrees := make([]*document.Node, 0, len(allApplications)+5)
retainedTrees = append(retainedTrees, decoded.final, final, structuralInput, preCLI)
retainedTrees := make([]*document.Node, 0, len(allApplications)+4)
retainedTrees = append(retainedTrees, decoded.final, final, preCLI)
for _, application := range allApplications {
retainedTrees = append(retainedTrees, application.value)
}
@@ -128,7 +127,6 @@ func publishLoadResult[T any](schema *schemaDescriptor, definition Definition[T]
baseline: decoded.baseline,
input: decoded.final,
inputOrigins: cloneOriginIndex(decoded.origins),
structuralInput: structuralInput,
preCLI: preCLI,
preCLIOrigins: cloneOrigins(resolved.preCLIOrigins),
postDecodeApps: cloneHistoryApplications(resolved.postDecodeApps),