Join Slack
Powered by
Has anyone seen something like ``` val foo = bar ?...
# getting-started
g
gabrielfv
08/14/2018, 4:35 PM
Has anyone seen something like
Copy code
val foo = bar ?: null.also { /* do something only when null */ }
o
orangy
08/14/2018, 4:43 PM
run
?
g
gabrielfv
08/14/2018, 4:57 PM
That makes more sense to me, but we're now arguing here if that
?: null.also
approach would perform better than the if check
gabrielfv
08/14/2018, 4:58 PM
It looks like microoptimization that the compiler can get ahold of
👍 1
3
Views
Open in Slack
Previous
Next