Use while loop for progressions that cannot overflow (instead of
do-while with enclosing "not empty" check). Also do not add additional "not empty" condition for `until` loops when the given bound is a constant != MIN_VALUE.
This commit is contained in:
committed by
max-kammerer
parent
ba0e016c4e
commit
7680e7fd56
+1
-4
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
fun test() {
|
||||
var sum = 0
|
||||
for (i in arrayOf("", "", "", "").indices) {
|
||||
@@ -12,6 +11,4 @@ fun test() {
|
||||
// 0 getFirst
|
||||
// 0 getLast
|
||||
|
||||
// 0 IF_ICMPGT
|
||||
// 0 IF_ICMPEQ
|
||||
// 1 IF_ICMPGE
|
||||
// 1 IF_ICMP
|
||||
|
||||
+1
-4
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
fun test() {
|
||||
var sum = 0
|
||||
for (i in intArrayOf(0, 0, 0, 0).indices) {
|
||||
@@ -12,6 +11,4 @@ fun test() {
|
||||
// 0 getFirst
|
||||
// 0 getLast
|
||||
|
||||
// 0 IF_ICMPGT
|
||||
// 0 IF_ICMPEQ
|
||||
// 1 IF_ICMPGE
|
||||
// 1 IF_ICMP
|
||||
|
||||
Reference in New Issue
Block a user