"Remove redundant 'if'" now works correctly with labeled return
So #KT-23109 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
733cb42ced
commit
5d1f5d9bca
@@ -0,0 +1,11 @@
|
||||
// "Remove redundant 'if' statement" "true"
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
listOf(1,2,3).find {
|
||||
<caret>if (it > 0) {
|
||||
return@find true
|
||||
} else {
|
||||
return@find false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Remove redundant 'if' statement" "true"
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
listOf(1,2,3).find {
|
||||
return@find it > 0
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user