Added comment
This commit is contained in:
+2
@@ -93,6 +93,8 @@ object IntroduceIndexMatcher : TransformationMatcher {
|
|||||||
val visited = HashSet<Instruction>()
|
val visited = HashSet<Instruction>()
|
||||||
return traverseFollowingInstructions(from, visited) { instruction ->
|
return traverseFollowingInstructions(from, visited) { instruction ->
|
||||||
val nextInstructionScope = instruction.blockScope.block
|
val nextInstructionScope = instruction.blockScope.block
|
||||||
|
// we should either reach the target instruction or exit the outer loop on every branch
|
||||||
|
// (if we won't do this on some branch we will finally exit the inner loop and return false from traverseFollowingInstructions)
|
||||||
when {
|
when {
|
||||||
instruction == to -> TraverseInstructionResult.SKIP
|
instruction == to -> TraverseInstructionResult.SKIP
|
||||||
!outerLoop.isAncestor(nextInstructionScope, strict = false) -> TraverseInstructionResult.SKIP // we are out of the outer loop - it's ok
|
!outerLoop.isAncestor(nextInstructionScope, strict = false) -> TraverseInstructionResult.SKIP // we are out of the outer loop - it's ok
|
||||||
|
|||||||
Reference in New Issue
Block a user