ForLoopsLowering: Reduce unnecessary temporary variables for the
"checked step" (check for a positive step arg) and "negated step" (negate the step arg when the nested step is negative).
This commit is contained in:
committed by
Alexander Udalov
parent
291d62f653
commit
b1ce21bc55
+1
-2
@@ -14,12 +14,11 @@ fun box(): String {
|
||||
// // Standard form of loop over progression
|
||||
// var inductionVar = 1
|
||||
// val last = 4
|
||||
// val step = 1
|
||||
// if (inductionVar <= last) {
|
||||
// // Loop is not empty
|
||||
// do {
|
||||
// val i = inductionVar
|
||||
// inductionVar += step
|
||||
// inductionVar += 1
|
||||
// // Loop body
|
||||
// } while (inductionVar <= last)
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user