https://kotlinlang.org logo
#announcements
Title
# announcements
k

karelpeeters

06/20/2017, 5:43 PM
Is there a way to simplify
return if (resource != null) something(resource) else null
using some of the null-safety operators?
r

russhwolf

06/20/2017, 5:45 PM
karelpeeters:
return resource?.let { something(it) }
k

karelpeeters

06/20/2017, 5:46 PM
Thanks, that works.
k

kingsley

06/24/2017, 1:08 PM
return resource?.let(::something)
2 Views