Skip to content

Commit

Permalink
exclude self from dominators
Browse files Browse the repository at this point in the history
  • Loading branch information
adonovan committed Apr 9, 2021
1 parent 48a24c6 commit 97210bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spaghetti.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 97210bb

Please sign in to comment.