Do the same but more the kotlin way
This commit is contained in:
parent
3a11b6ae4e
commit
949e312a0f
1 changed files with 5 additions and 7 deletions
|
@ -7,12 +7,10 @@ class PassLocation {
|
|||
var lat: Double = 0.toDouble()
|
||||
var lon: Double = 0.toDouble()
|
||||
|
||||
fun getNameWithFallback(pass: Pass): String? {
|
||||
if (name == null || name!!.isEmpty()) {
|
||||
// fallback for passes with locations without description - e.g. AirBerlin
|
||||
return pass.description
|
||||
}
|
||||
return name
|
||||
fun getNameWithFallback(pass: Pass) = if (name.isNullOrBlank()) {
|
||||
// fallback for passes with locations without description - e.g. AirBerlin
|
||||
pass.description
|
||||
} else {
|
||||
name
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue