Skip to content

Commit 9ece022

Browse files
committed
refactor : else 제거
1 parent cfef5d2 commit 9ece022

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

presentation/src/main/java/com/stop/ui/mission/MissionFragment.kt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,18 @@ class MissionFragment : Fragment(), MissionHandler {
161161
viewLifecycleOwner.lifecycleScope.launch {
162162
val timeUnit = (subwayRoute.sectionTime * SECOND_UNIT / subwayRoute.line.size).toLong()
163163
subwayRoute.line.forEachIndexed { index, nowLocation ->
164-
if (index == 0) return@forEachIndexed
165-
else {
166-
val beforeLocation = subwayRoute.line[index - 1]
167-
tMap.drawMoveLine(
168-
TMapPoint(nowLocation.latitude, nowLocation.longitude),
169-
TMapPoint(beforeLocation.latitude, beforeLocation.longitude),
170-
Marker.SUBWAY_LINE + (index - 1).toString(),
171-
Marker.SUBWAY_LINE_COLOR
172-
)
164+
if (index == 0) {
165+
return@forEachIndexed
173166
}
167+
168+
val beforeLocation = subwayRoute.line[index - 1]
169+
tMap.drawMoveLine(
170+
TMapPoint(nowLocation.latitude, nowLocation.longitude),
171+
TMapPoint(beforeLocation.latitude, beforeLocation.longitude),
172+
Marker.SUBWAY_LINE + (index - 1).toString(),
173+
Marker.SUBWAY_LINE_COLOR
174+
)
175+
174176
viewModel.busCurrentLocation = Location(nowLocation.latitude, nowLocation.longitude)
175177

176178
tMap.makeMarker(

0 commit comments

Comments
 (0)