-
Notifications
You must be signed in to change notification settings - Fork 196
Closed
Labels
Description
Kotlin allows ternary operators to return.
This code:
func showTenants() {
guard let intent = coordinator.tenantsIntent() else {
return
}
navigationManager.show(intent, animation: .push)
}
Translates to
fun showTenants() {
val intent = coordinator.tenantsIntent()
if (intent == null) {
return
}
navigationManager.show(intent, animation = .push)
}
But could be
fun showTenants() {
val intent = coordinator.tenantsIntent() ?: return
navigationManager.show(intent, animation = .push)
}