Publish inspection through one frozen history model
This commit is contained in:
@@ -85,36 +85,14 @@ func documentCloneNodeCount(root *document.Node, limit int) (int, bool) {
|
||||
}
|
||||
|
||||
func addInspectionHistory(counter *retainedNodeCounter, inspection *Inspection) bool {
|
||||
if inspection == nil {
|
||||
if inspection == nil || inspection.history == nil {
|
||||
return false
|
||||
}
|
||||
for _, root := range []*document.Node{inspection.baseline, inspection.input, inspection.final, inspection.preCLI} {
|
||||
for _, root := range inspection.history.documentRoots() {
|
||||
if !counter.add(root) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
for _, application := range inspection.applications {
|
||||
if !counter.add(application.value) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
for _, application := range inspection.postDecodeApps {
|
||||
if !counter.add(application.value) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
for _, snapshot := range inspection.resolution {
|
||||
if !counter.add(snapshot.before) || !counter.add(snapshot.after) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
for _, operations := range [][]inheritanceOperation{inspection.inheritance, inspection.metadata.inheritance} {
|
||||
for _, operation := range operations {
|
||||
if !counter.add(operation.parent) || !counter.add(operation.effective) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user