Normalize baseline and source history evidence
This commit is contained in:
@@ -147,28 +147,6 @@ func appendInputOriginEvent(events map[string][]Change, baseline map[string][]Ch
|
||||
appendInputChangeEvent(events, baseline, pointer, Change{Path: path.clone(), Origin: cloneOrigin(origin)})
|
||||
}
|
||||
|
||||
func originRepresentedByChange(path Path, origin Origin, change Change) bool {
|
||||
if change.Path.String() == path.String() {
|
||||
return originContainedBy(origin, change.Origin)
|
||||
}
|
||||
if !pathContains(change.Path, path) || origin.Layer != change.Origin.Layer || origin.Operation != change.Origin.Operation {
|
||||
return false
|
||||
}
|
||||
// A subtree replacement already records its descendants' contributions.
|
||||
// Their coordinates differ from the container's, but their sources must be
|
||||
// covered by the operation; matching only the precedence role is insufficient.
|
||||
recordedSources := make(map[string]struct{}, len(change.Origin.Locations))
|
||||
for _, recorded := range change.Origin.Locations {
|
||||
recordedSources[recorded.SourceID] = struct{}{}
|
||||
}
|
||||
for _, location := range origin.Locations {
|
||||
if _, found := recordedSources[location.SourceID]; !found {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func appendInputChangeEvent(events map[string][]Change, baseline map[string][]Change, pointer string, value Change) {
|
||||
change := cloneChange(value)
|
||||
history := events[pointer]
|
||||
|
||||
Reference in New Issue
Block a user