mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
Modified AsmUtil to generate calls to more specific append methods in the StringBuilder class in order to save computation time and make less temporary objects. Also adds unit-test to verify that the append(Object) method was invoked 0 times while the append(String) 3 times Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
11 lines
391 B
Kotlin
Vendored
11 lines
391 B
Kotlin
Vendored
// KT-5016 wrong StringBuilder append method invoked
|
|
class kt5016 {
|
|
fun f1(name : String) : String {
|
|
return "Hello $name!"
|
|
}
|
|
}
|
|
|
|
// 0 INVOKEVIRTUAL java/lang/StringBuilder.append \(Ljava/lang/Object;\)Ljava/lang/StringBuilder
|
|
// 3 INVOKEVIRTUAL java/lang/StringBuilder.append \(Ljava/lang/String;\)Ljava/lang/StringBuilder
|
|
// 1 INVOKEVIRTUAL java/lang/StringBuilder.toString
|