hi! is there any built in func to achieve that, or...
# announcements
d
hi! is there any built in func to achieve that, or it’s too late and i’m overengineering?
Copy code
fun <T> List<T>.switchIfEmpty(replacement: List<T>): List<T> = if (this.isEmpty()) replacement else this