KT-12733 'rangeTo' as a non-qualified call is not optimized in 'for'
Use ResolvedCall corresponding to 'for' loop range expression for optimized "for-in-range-literal". Cleanup.
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
fun Int.digitsUpto(end: Int): Int {
|
||||
var sum = 0
|
||||
for (i in rangeTo(end)) {
|
||||
sum = sum*10 + i
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
// 0 iterator
|
||||
// 0 getStart
|
||||
// 0 getEnd
|
||||
// 0 getFirst
|
||||
// 0 getLast
|
||||
Reference in New Issue
Block a user