Extract Function: Merge jumps with default exits if all exit points are equivalent
#KT-6598 Fixed
This commit is contained in:
@@ -9,5 +9,6 @@ fun foo(a: Int): Int {
|
||||
<selection>if (a > 0) throw Exception("")
|
||||
if (a + b > 0) continue
|
||||
println(a - b)</selection>
|
||||
println(a + b)
|
||||
}
|
||||
}
|
||||
+1
@@ -7,6 +7,7 @@ fun foo(a: Int): Int {
|
||||
val b: Int = 1
|
||||
for (n in 1..b) {
|
||||
if (b(a, b)) continue
|
||||
println(a + b)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -9,4 +9,5 @@ fun foo(a: Int) {
|
||||
<selection>if (a > 0) throw Exception("")
|
||||
if (b + a > 0) return
|
||||
println(a - b)</selection>
|
||||
println(a + b)
|
||||
}
|
||||
+1
@@ -7,6 +7,7 @@ fun foo(a: Int) {
|
||||
val b: Int = 1
|
||||
|
||||
if (b(a, b)) return
|
||||
println(a + b)
|
||||
}
|
||||
|
||||
private fun b(a: Int, b: Int): Boolean {
|
||||
|
||||
Reference in New Issue
Block a user