mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-26 16:36:26 -06:00
correct the direction and walk order of the graph
This commit is contained in:
parent
88ad938cc6
commit
493ec4e6c5
@ -48,12 +48,12 @@ func ApplyMoves(stmts []MoveStatement, state *states.State) map[addrs.UniqueKey]
|
||||
// The starting nodes are the ones that don't depend on any other nodes.
|
||||
startNodes := make(dag.Set, len(stmts))
|
||||
for _, v := range g.Vertices() {
|
||||
if len(g.UpEdges(v)) == 0 {
|
||||
if len(g.DownEdges(v)) == 0 {
|
||||
startNodes.Add(v)
|
||||
}
|
||||
}
|
||||
|
||||
g.DepthFirstWalk(startNodes, func(v dag.Vertex, depth int) error {
|
||||
g.ReverseDepthFirstWalk(startNodes, func(v dag.Vertex, depth int) error {
|
||||
stmt := v.(*MoveStatement)
|
||||
|
||||
for _, ms := range state.Modules {
|
||||
|
Loading…
Reference in New Issue
Block a user