mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
POP operations are backward-propagated. Operation can't be transformed if its result is moved within stack (by DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, or SWAP). Unnecessary operations are replaced with NOPs (for debugger). Unnecessary NOPs are removed. KT-9922 Suboptimal generation for simple safe call with unused return value KT-11116 Optimize methods returning Unit
20 lines
425 B
Kotlin
Vendored
20 lines
425 B
Kotlin
Vendored
fun test(ss: List<String?>) {
|
|
val shortStrings = hashSetOf<String>()
|
|
val longStrings = hashSetOf<String>()
|
|
for (s in ss) {
|
|
s?.let {
|
|
if (s.length < 4) {
|
|
shortStrings.add(s)
|
|
}
|
|
else {
|
|
longStrings.add(s)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// 2 POP
|
|
// 0 INVOKESTATIC java/lang/Boolean\.valueOf
|
|
// 0 CHECKCAST java/lang/Boolean
|
|
// 0 ACONST_NULL
|