Extract Function: Take duplicates into account when choosing placement of extracted function

#KT-5916 Fixed
This commit is contained in:
Alexey Sedunov
2014-10-20 18:13:19 +04:00
parent c492ffee08
commit b5e1fe613c
13 changed files with 109 additions and 56 deletions
@@ -11,17 +11,6 @@ fun test(a: Int): Int {
return t
}
private fun i(a: Int, b: Int): Int {
var b1 = b
return if (a > 0) {
b1++
b1 + a
} else {
b1--
b1 - a
}
}
fun foo1() {
val x = 1
var y: Int = x
@@ -68,3 +57,14 @@ fun foo5(x: Int): Int {
var p: Int = 1
i(x, p)
}
private fun i(a: Int, b: Int): Int {
var b1 = b
return if (a > 0) {
b1++
b1 + a
} else {
b1--
b1 - a
}
}