Skip to content

Commit

Permalink
fix: updated code to readable (review)
Browse files Browse the repository at this point in the history
  • Loading branch information
thguss committed Aug 29, 2024
1 parent f4a2bec commit d43d17f
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ class TmapNavigationAdapter(
): Distance {
val startCoordinate = startPlace.getCoordinate()
val endCoordinate = endPlace.getCoordinate()
return startCoordinate.takeIf { it.isValid() }
?.takeIf { endCoordinate.isValid() }
?.let { getDistanceFromTmap(startCoordinate, endCoordinate) }
?: Distance.EMPTY
return if (startCoordinate.isValid() && endCoordinate.isValid()) {
getDistanceFromTmap(startCoordinate, endCoordinate)
} else {
Distance.EMPTY
}
}

private fun getDistanceFromTmap(
Expand Down

0 comments on commit d43d17f

Please sign in to comment.