do not look for all descendants from root outputs

The output destroy node only needs to connect to each of the output's
up-edges in order to be connected transitively to all of the outputs
dependencies. In large, highly-connected graphs, this may save
considerable time for each output.
This commit is contained in:
James Bardin 2020-06-10 22:35:24 -04:00
parent 8e4bd669e8
commit c0a5214aec
1 changed files with 1 additions and 4 deletions

View File

@ -86,10 +86,7 @@ func (t *destroyRootOutputTransformer) Transform(g *Graph) error {
log.Printf("[TRACE] creating %s", node.Name())
g.Add(node)
deps, err := g.Descendents(v)
if err != nil {
return err
}
deps := g.UpEdges(v)
// the destroy node must depend on the eval node
deps.Add(v)