Formatting of "?:" onto the next line
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
fun foo(list: List<String>) {
|
||||
val <caret>result = list
|
||||
.firstOrNull { it.length > 0 }
|
||||
?.let { bar(it) } ?: ""
|
||||
?.let { bar(it) }
|
||||
?: ""
|
||||
}
|
||||
|
||||
fun bar(s: String): String = s
|
||||
|
||||
+2
-1
@@ -3,5 +3,6 @@
|
||||
fun foo(list: List<String>): Int {
|
||||
<caret>return list
|
||||
.firstOrNull { it.isNotEmpty() }
|
||||
?.length ?: -1
|
||||
?.length
|
||||
?: -1
|
||||
}
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'firstOrNull{}'"
|
||||
fun foo(list: List<String>): String {
|
||||
<caret>return list.firstOrNull { it.isNotEmpty() } ?: ""
|
||||
<caret>return list.firstOrNull { it.isNotEmpty() }
|
||||
?: ""
|
||||
}
|
||||
Reference in New Issue
Block a user