diff options
Diffstat (limited to 'pkg/subsystem/linux')
| -rw-r--r-- | pkg/subsystem/linux/parents.go | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/pkg/subsystem/linux/parents.go b/pkg/subsystem/linux/parents.go index 40ba10b7f..5c66782c1 100644 --- a/pkg/subsystem/linux/parents.go +++ b/pkg/subsystem/linux/parents.go @@ -35,8 +35,7 @@ func transitiveReduction(list []*entity.Subsystem) { for _, s := range list { removeParents := map[*entity.Subsystem]bool{} for _, p := range s.Parents { - reachable := reachableParents(p) - for otherP := range reachable { + for otherP := range p.ReachableParents() { removeParents[otherP] = true } } @@ -50,20 +49,6 @@ func transitiveReduction(list []*entity.Subsystem) { } } -// reachableParents lists all entity.Subsystem entries reachable from the given one. -func reachableParents(start *entity.Subsystem) map[*entity.Subsystem]bool { - ret := make(map[*entity.Subsystem]bool) - var dfs func(node *entity.Subsystem) - dfs = func(node *entity.Subsystem) { - for _, p := range node.Parents { - ret[p] = true - dfs(p) - } - } - dfs(start) - return ret -} - // loopsExist is a helper method that verifies that the resulting graph has no loops. func loopsExist(list []*entity.Subsystem) bool { type graphNode struct { |
