From 97210bb0025836c49efd00fb4eda11b86c443ac0 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Fri, 9 Apr 2021 12:57:19 -0400 Subject: [PATCH] exclude self from dominators --- spaghetti.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spaghetti.go b/spaghetti.go index 10fc9ab..36335f7 100644 --- a/spaghetti.go +++ b/spaghetti.go @@ -270,7 +270,7 @@ func onData(w http.ResponseWriter, req *http.Request) { // in the jstree node's .original field. Package int // -1 for non-package nodes Imports []int - ImportedBy []int + ImportedBy []int Dominators []int // path through dom tree, from package to root inclusive Path []int // path through package graph, from package to root inclusive } @@ -328,7 +328,7 @@ func onData(w http.ResponseWriter, req *http.Request) { for _, imp := range e.node.importedBy { item.ImportedBy = append(item.ImportedBy, imp.index) } - for n := e.node; n != nil; n = n.Idom() { + for n := e.node.Idom(); n != nil; n = n.Idom() { item.Dominators = append(item.Dominators, n.index) } // Don't show the synthetic root node (if any) in the path.