Skip to content

Commit

Permalink
fix: catch root.Id instead of entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Musat committed Dec 12, 2022
1 parent 0aa5e34 commit b9aa1ea
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/graph/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ func makeNodes[T any](
parser NodeParser[T],
seen map[string]*node.Node[T],
) (*node.Node[T], error) {
if cached, ok := seen[entrypoint]; ok {
return cached, nil
}
root, err := parser.Parse(entrypoint)
if err != nil {
return nil, err
} else if _, ok := seen[entrypoint]; !ok {
} else if cached, ok := seen[root.Id]; ok {
return cached, nil
} else {
seen[entrypoint] = root
}

Expand Down

0 comments on commit b9aa1ea

Please sign in to comment.