Alexey Anufriev
08/31/2020, 6:34 PMif (event == null) {
return emptyArray()
}
or this
event ?: return emptyArray()
?
note: this is just the first line of the method, then comes more logicnanodeath
08/31/2020, 6:36 PMevent
expression as a statement.
that is...I think the second would be okay if it the "return value" event
was used, like in an assignment, but with just what we see here, the first is clearer.Shawn
08/31/2020, 6:39 PMval event = getEvent()
if (event == null) {
return emptyArray()
}
Shawn
08/31/2020, 6:39 PMval event = getEvent() ?: return emptyArray()
nanodeath
08/31/2020, 6:43 PM