And another, does anyone know why there isn't a `g...
# announcements
m
And another, does anyone know why there isn't a
getOrElse
in Array that just takes a literal default not like currently a function from index to value ? I know you can do
array.getOrNull(idx) ?: defaultValue
but it reads more verbose
i
Why don't you want to use
getOrElse
? Note that it is inlined, so there's no object allocated for the function.
1