Cleanup getLineCount

This commit is contained in:
Nikita Bobko
2020-05-22 17:57:25 +03:00
committed by Nikita Bobko
parent 603bae398f
commit a94d2211e4
16 changed files with 38 additions and 48 deletions
@@ -8,10 +8,8 @@ fun foo(a: Int): Int {
return i(a, b)
}
private fun i(a: Int, b: Int): Int {
return when (a + b) {
0 -> b
1 -> -b
else -> a - b
}
private fun i(a: Int, b: Int) = when (a + b) {
0 -> b
1 -> -b
else -> a - b
}
@@ -18,11 +18,9 @@ fun foo(o: Any) {
val x = i(o)
}
private fun i(o: Any): Int {
return when (o) {
is A -> {
if (o is T) o.a + o.t else o.a
}
else -> o.hashCode()
private fun i(o: Any) = when (o) {
is A -> {
if (o is T) o.a + o.t else o.a
}
else -> o.hashCode()
}