Skip to content

Commit

Permalink
move comment for better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
jbardin committed Dec 22, 2021
1 parent 99704ee commit 7a5c1f3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/refactoring/move_execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,18 +244,18 @@ func statementDependsOn(a, b *MoveStatement) bool {
return false
}

// if A is not declared in an ancestor module, then we can't be nested
// within a module index change.
if len(a.To.Module()) >= len(b.To.Module()) {
return true
}

// If a nested move has a dependency, we need to rule out the possibility
// that this is a move inside a module only changing indexes. If an
// ancestor module is only changing the index of a nested module, any
// nested move statements are going to match both the From and To address
// when the base name is not changing, causing a cycle in the order of
// operations.

// if A is not declared in an ancestor module, then we can't be nested
// within a module index change.
if len(a.To.Module()) >= len(b.To.Module()) {
return true
}
// We only want the nested move statement to depend on the outer module
// move, so we only test this in the reverse direction.
if a.From.IsModuleReIndex(a.To) {
Expand Down

0 comments on commit 7a5c1f3

Please sign in to comment.