Reuse frozen inspection mapping lookups
This commit is contained in:
@@ -65,7 +65,7 @@ func cloneHistoryApplications(values []historyApplication) []historyApplication
|
||||
return cloned
|
||||
}
|
||||
|
||||
func applicationOperationPath(application historyApplication, query Path) (Path, bool) {
|
||||
func applicationOperationPath(application historyApplication, query Path, lookup *documentLookup) (Path, bool) {
|
||||
if !application.path.valid() || application.value == nil {
|
||||
return Path{}, false
|
||||
}
|
||||
@@ -80,7 +80,7 @@ func applicationOperationPath(application historyApplication, query Path) (Path,
|
||||
}
|
||||
for length := 1; length <= len(query.segments); length++ {
|
||||
prefix := Path{segments: clonePathSegments(query.segments[:length], 0)}
|
||||
node, present := documentAtPath(application.value, prefix)
|
||||
node, present := documentAtPathWithLookup(application.value, prefix, lookup)
|
||||
if !present {
|
||||
return Path{}, false
|
||||
}
|
||||
@@ -91,7 +91,7 @@ func applicationOperationPath(application historyApplication, query Path) (Path,
|
||||
return Path{}, false
|
||||
}
|
||||
|
||||
func historyApplicationOrigin(application historyApplication, operationPath Path) Origin {
|
||||
func historyApplicationOrigin(application historyApplication, operationPath Path, lookup *documentLookup) Origin {
|
||||
if application.origin.Layer != "" {
|
||||
return cloneOrigin(application.origin)
|
||||
}
|
||||
@@ -100,7 +100,7 @@ func historyApplicationOrigin(application historyApplication, operationPath Path
|
||||
if !ok {
|
||||
return origin
|
||||
}
|
||||
if node, present := documentAtPath(application.value, relative); present {
|
||||
if node, present := documentAtPathWithLookup(application.value, relative, lookup); present {
|
||||
origin.Locations = []Location{publicLocation(node.Location)}
|
||||
}
|
||||
return origin
|
||||
|
||||
Reference in New Issue
Block a user