Refactor code in "simplify call chain" (relates to KT-28576)
This commit is contained in:
Vendored
+3
-3
@@ -1,7 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
val x = listOf(1, 2, 3).joinToString(prefix = "= ", separator = " + ") {
|
||||
val sb = StringBuilder()
|
||||
sb.append(it).append(" + ").append(it)
|
||||
sb
|
||||
val sb = StringBuilder()
|
||||
sb.append(it).append(" + ").append(it)
|
||||
sb
|
||||
}
|
||||
+3
-3
@@ -8,9 +8,9 @@ suspend fun myFunction(context: CoroutineContext, switch: Int): Int {
|
||||
with (GlobalScope) {
|
||||
when (switch) {
|
||||
0 -> return withContext(Dispatchers.Default) {
|
||||
val x = 123
|
||||
x * x
|
||||
}
|
||||
val x = 123
|
||||
x * x
|
||||
}
|
||||
1 -> return withContext(context) { -1 }
|
||||
else -> return withContext(Dispatchers.Default) { 9 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user