ifTrue

fun Any?.ifTrue(): Any?

一个过滤判断赋值,可以用来过滤空数组、0 Duration、0、false字符串等等,将这些对象直接视为 null

var some:String? = null
val other:String? = "xxx"
if (other.isNotEmpty()){
some = other
}

var some = other.ifTrue()