FIR2IR: wrap do-while loop in IrBlock
"so that variables declared in loop body are not visible outside of the
loop" (from commit d096f1d)
This commit is contained in:
committed by
TeamCityServer
parent
08670114c8
commit
7898d167f3
+10
-8
@@ -223,14 +223,16 @@ internal class ArrayMapImpl<T : Any> : ArrayMap<T> {
|
||||
private set
|
||||
|
||||
protected override fun computeNext() {
|
||||
do// COMPOSITE {
|
||||
val <unary>: Int = <this>.<get-index>()
|
||||
<this>.<set-index>(<set-?> = <unary>.inc())
|
||||
<unary>
|
||||
// } while (when {
|
||||
less(arg0 = <this>.<get-index>(), arg1 = <this>.<get-data>().<get-size>()) -> EQEQ(arg0 = <this>.<get-data>().get(index = <this>.<get-index>()), arg1 = null)
|
||||
else -> false
|
||||
})
|
||||
{ // BLOCK
|
||||
do// COMPOSITE {
|
||||
val <unary>: Int = <this>.<get-index>()
|
||||
<this>.<set-index>(<set-?> = <unary>.inc())
|
||||
<unary>
|
||||
// } while (when {
|
||||
less(arg0 = <this>.<get-index>(), arg1 = <this>.<get-data>().<get-size>()) -> EQEQ(arg0 = <this>.<get-data>().get(index = <this>.<get-index>()), arg1 = null)
|
||||
else -> false
|
||||
})
|
||||
}
|
||||
when {
|
||||
greaterOrEqual(arg0 = <this>.<get-index>(), arg1 = <this>.<get-data>().<get-size>()) -> <this>.done()
|
||||
else -> <this>.setNext(value = <this>.<get-data>().get(index = <this>.<get-index>()) as T)
|
||||
|
||||
Reference in New Issue
Block a user