Basic Kotlin question. Am I right that this: ``` v...
# announcements
m
Basic Kotlin question. Am I right that this:
Copy code
var matches = liveMatches.value
if(matches == null) {
    matches = ArrayList()
}
Can be shortened to this:
Copy code
var matches = liveMatches.value ?: ArrayList()
👌 3
g
there is also handy extension
List?.orEmpty()
, but you cannot use it in your case, it returns immutable empty list
m
Thanks for the tip, though!