prune unused providers from the graph, again
The provider transformers remove extra provider nodes when they are initially setup, but it may turn out that they are not used later on. The pruneUnusedNodesTransformer takes care of removing unused expansion nodes, which originally required a provider, and hence may cause some provider nodes to no longer be needed. We can also detect these and remove them during the pruneUnusedNodesTransformer process.
This commit is contained in:
parent
7674e19d4e
commit
58b085f0dc
|
@ -221,6 +221,13 @@ func (t *pruneUnusedNodesTransformer) Transform(g *Graph) error {
|
|||
}
|
||||
}
|
||||
|
||||
case GraphNodeProvider:
|
||||
// Providers that may have been required by expansion nodes
|
||||
// that we no longer need can also be removed.
|
||||
if g.UpEdges(n).Len() > 0 {
|
||||
return
|
||||
}
|
||||
|
||||
default:
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue