3 ms·
Does kotlinc optimize away inline ranges like that, or does this result in a range object being constructed and discarded?
by nitrogen 6y ago
Does kotlinc optimize away inline ranges like that, or does this result in a range object being constructed and discarded?
- RandomBK 6y agoI haven't heard of any instances of Kotlin itself optimizing these things away, but the JVM may be able to do so during its various JIT passes. It's definitely not something you can necessarily rely on, though. Luckily, these convenience methods are usually implemented as inline extension functions, so the whole thing will get inlined into the calling method, making JIT optimization more likely.