"Simplify comparison": remove if when possible after applying quickfix

#KT-25995 Fixed
This commit is contained in:
Toshiaki Kameyama
2018-08-28 05:39:04 +03:00
committed by Mikhail Glukhikh
parent 688fc386b6
commit 5c83c247d7
6 changed files with 58 additions and 33 deletions
+4 -2
View File
@@ -5,7 +5,9 @@ fun foo(x: String?) {
}
else {
if (<caret>x == null) {
bar()
}
}
}
}
fun bar() {}
@@ -4,8 +4,7 @@ fun foo(x: String?) {
}
else {
if (false) {
}
}
}
}
fun bar() {}
+4 -2
View File
@@ -1,6 +1,8 @@
// "Simplify comparison" "true"
fun foo(x: Int) {
if (<caret>x != null) {
bar()
}
}
}
fun bar() {}
+3 -3
View File
@@ -1,6 +1,6 @@
// "Simplify comparison" "true"
fun foo(x: Int) {
if (true) {
bar()
}
}
}
fun bar() {}