Extract Function: Choose default visibility at analysis phase
This commit is contained in:
@@ -9,7 +9,7 @@ fun foo(a: Int) {
|
||||
unit(a, b)
|
||||
}
|
||||
|
||||
fun unit(a: Int, b: Int) {
|
||||
private fun unit(a: Int, b: Int) {
|
||||
if (a > 0) {
|
||||
println(a)
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ fun foo(a: Int) {
|
||||
println(c)
|
||||
}
|
||||
|
||||
fun unit(a: Int, b: Int) {
|
||||
private fun unit(a: Int, b: Int) {
|
||||
if (a > 0) {
|
||||
println(a)
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ fun foo(a: Int) {
|
||||
unit(a)
|
||||
}
|
||||
|
||||
fun unit(a: Int) {
|
||||
private fun unit(a: Int) {
|
||||
var t = a
|
||||
while (t > 0) {
|
||||
if (t == 2) continue
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ fun foo(a: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun unit(a: Int, b: Int) {
|
||||
private fun unit(a: Int, b: Int) {
|
||||
if (a > 0) {
|
||||
bar(a)
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -14,6 +14,6 @@ fun foo(a: Int) {
|
||||
unit(a, b)
|
||||
}
|
||||
|
||||
fun unit(a: Int, b: Int) {
|
||||
private fun unit(a: Int, b: Int) {
|
||||
if (a > 0) bar(a) else b
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ fun foo(a: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun unit(a: Int, b: Int) {
|
||||
private fun unit(a: Int, b: Int) {
|
||||
when {
|
||||
a > 0 -> {
|
||||
bar(a)
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ fun foo(a: Int) {
|
||||
|
||||
}
|
||||
|
||||
fun unit(a: Int, b: Int) {
|
||||
private fun unit(a: Int, b: Int) {
|
||||
when {
|
||||
a > 0 -> bar(a)
|
||||
else -> b
|
||||
|
||||
Reference in New Issue
Block a user