Invert if condition intention: 'isEmpty' <-> 'isNotEmpty'

#KT-34593 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-11-11 14:13:38 +09:00
committed by Vladimir Dolzhenko
parent 79c15e49b6
commit d5e71ebef1
11 changed files with 126 additions and 15 deletions
+10
View File
@@ -0,0 +1,10 @@
// WITH_RUNTIME
fun foo(i: Int) {}
fun test(s: String) {
<caret>if (s.isEmpty()) {
foo(1)
} else {
foo(2)
}
}
@@ -0,0 +1,10 @@
// WITH_RUNTIME
fun foo(i: Int) {}
fun test(s: String) {
<caret>if (s.isNotEmpty()) {
foo(2)
} else {
foo(1)
}
}
@@ -0,0 +1,10 @@
// WITH_RUNTIME
fun foo(i: Int) {}
fun test(s: String) {
<caret>if (s.isNotEmpty()) {
foo(1)
} else {
foo(2)
}
}
@@ -0,0 +1,10 @@
// WITH_RUNTIME
fun foo(i: Int) {}
fun test(s: String) {
<caret>if (s.isEmpty()) {
foo(2)
} else {
foo(1)
}
}
@@ -0,0 +1,10 @@
// WITH_RUNTIME
fun foo(i: Int) {}
fun test(s: String) {
<caret>if (!s.isEmpty()) {
foo(1)
} else {
foo(2)
}
}
@@ -0,0 +1,10 @@
// WITH_RUNTIME
fun foo(i: Int) {}
fun test(s: String) {
<caret>if (s.isEmpty()) {
foo(2)
} else {
foo(1)
}
}
@@ -0,0 +1,10 @@
// WITH_RUNTIME
fun foo(i: Int) {}
fun test(s: String) {
<caret>if (!s.isNotEmpty()) {
foo(1)
} else {
foo(2)
}
}
@@ -0,0 +1,10 @@
// WITH_RUNTIME
fun foo(i: Int) {}
fun test(s: String) {
<caret>if (s.isNotEmpty()) {
foo(2)
} else {
foo(1)
}
}