https://kotlinlang.org logo
d

Dirk Seewald

07/25/2021, 9:21 PM
Is there a way i can fix that?
l

louiscad

07/25/2021, 11:17 PM
Use the variable
🌌 1
🧠 2
d

Dirk Seewald

07/26/2021, 9:12 AM
But i use it in the for loop
l

louiscad

07/26/2021, 9:22 AM
Not in its body, so it's optimized away. You can use it in the loop body or after the loop, or just reference it by putting
notDeleted
alone on a line.
d

Dirk Seewald

07/26/2021, 10:51 AM
No i can't use it in the loop and not in the line where i create the loop
l

louiscad

07/26/2021, 10:53 AM
You can
Copy code
for (i in whatever) {
   // Some code
}
whatever
The last line is what you want to do.
d

Dirk Seewald

07/26/2021, 4:41 PM
ok
l

louiscad

07/26/2021, 7:15 PM
Did it work?
d

Dirk Seewald

07/27/2021, 11:27 AM
i haven't tested it yet
3 Views