if 문의 isEmpty, isBlank, isNotEmpty 또는 isNotBlank 호출을 보고합니다.
빠른 수정에서는 if 조건을 ifEmpty 또는 ifBlank 호출로 바꿉니다.
예:
fun test(list: List<Int>): List<Int> {
return if (list.isEmpty()) {
println()
foo()
} else {
list
}
}
빠른 수정을 적용한 후:
fun test(list: List<Int>): List<Int> {
return list.ifEmpty {
println()
foo()
}
}
이 검사는 프로젝트 또는 모듈의 Kotlin 언어 버전이 1.3 이상인 경우에만 보고합니다.