Retain matched resolution evidence in history

This commit is contained in:
2026-11-02 14:46:13 +00:00
parent d120fe907b
commit c61597d137
6 changed files with 53 additions and 7 deletions

View File

@@ -16,6 +16,17 @@ type resolutionCorrespondence struct {
collections map[string]collectionCorrespondence
}
func (c resolutionCorrespondence) clone() resolutionCorrespondence {
result := resolutionCorrespondence{collections: make(map[string]collectionCorrespondence, len(c.collections))}
for key, collection := range c.collections {
collection.path = collection.path.clone()
collection.entryToFinal = append([]int(nil), collection.entryToFinal...)
collection.finalToEntry = append([]int(nil), collection.finalToEntry...)
result.collections[key] = collection
}
return result
}
func buildResolutionCorrespondence(entry, final *document.Node, policy sequencePolicy) resolutionCorrespondence {
result := resolutionCorrespondence{collections: make(map[string]collectionCorrespondence)}
var indexes mappingIndex