Kotlin provides the functions ifBlank and ifEmpty so we should flag the points where this functions could be used. Example:
if (api.name.isBlank()) "John" else api.name
can be replaced to:
api.name.ifBlank { "John" }
The same for ifEmpty.
Context
https://twitter.com/kotlin/status/1277897234043097090
Kotlin provides the functions
ifBlankandifEmptyso we should flag the points where this functions could be used. Example:if (api.name.isBlank()) "John" else api.namecan be replaced to:
api.name.ifBlank { "John" }The same for
ifEmpty.Context
https://twitter.com/kotlin/status/1277897234043097090