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 lat: Double = 0.toDouble()
|
||||||
var lon: Double = 0.toDouble()
|
var lon: Double = 0.toDouble()
|
||||||
|
|
||||||
fun getNameWithFallback(pass: Pass): String? {
|
fun getNameWithFallback(pass: Pass) = if (name.isNullOrBlank()) {
|
||||||
if (name == null || name!!.isEmpty()) {
|
// fallback for passes with locations without description - e.g. AirBerlin
|
||||||
// fallback for passes with locations without description - e.g. AirBerlin
|
pass.description
|
||||||
return pass.description
|
} else {
|
||||||
}
|
name
|
||||||
return name
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue