fix compiler not optimizing x+=1 into x++ anymore

This commit is contained in:
Irmen de Jong 2023-03-10 02:45:25 +01:00
parent 6c34672549
commit b7a6f3ec75

View File

@ -322,7 +322,7 @@ class StatementOptimizer(private val program: Program,
repeat(rightCv.toInt()) { repeat(rightCv.toInt()) {
incs.statements.add(PostIncrDecr(assignment.target.copy(), "++", assignment.position)) incs.statements.add(PostIncrDecr(assignment.target.copy(), "++", assignment.position))
} }
listOf(IAstModification.ReplaceNode(assignment, if(incs.statements.size==1) incs.statements[0] else incs, parent)) return listOf(IAstModification.ReplaceNode(assignment, if(incs.statements.size==1) incs.statements[0] else incs, parent))
} }
} }
} }