Reuse document indexes for collection policy checks
This commit is contained in:
@@ -103,15 +103,19 @@ func mergeInheritanceCollectionPolicies(
|
||||
for key, entry := range child.collections {
|
||||
paths[key] = entry.destination.clone()
|
||||
}
|
||||
var lookup *documentLookup
|
||||
if len(paths) != 0 {
|
||||
lookup = buildDocumentLookup(parentValue, childValue)
|
||||
}
|
||||
var diagnostics []Diagnostic
|
||||
for _, path := range paths {
|
||||
relative, inside := relativeHistoryPath(parentRootPath, path)
|
||||
var retained, incoming *document.Node
|
||||
if inside {
|
||||
if !replaced.contains(path, false) {
|
||||
retained, _ = documentAtPath(parentValue, relative)
|
||||
retained, _ = documentAtPathWithLookup(parentValue, relative, lookup)
|
||||
}
|
||||
incoming, _ = documentAtPath(childValue, relative)
|
||||
incoming, _ = documentAtPathWithLookup(childValue, relative, lookup)
|
||||
}
|
||||
resolution, lower, _, active, issues := inheritanceCollectionResolution(path, parent, child, applicationPolicy, incoming)
|
||||
if len(issues) != 0 {
|
||||
|
||||
Reference in New Issue
Block a user