Just noticed that for JVM WHEN statement by string...
# compiler
p
Just noticed that for JVM WHEN statement by string value with constant cases Kotlin produces else-if chains, while Java compiler make optimizations - generating switch by hash code with equals check. Is there any plans for such optimization in Kotlin backend compiler side?
might not trigger if the subject is nullable?
p
I noticed it in 2.0.20-beta. Check on not nullable strings.
May be there is some number of cases after which it optimize. I was checking on 3 cases. Will check on more cases later.