Skip to content

Conversation

@dzinad
Copy link
Contributor

@dzinad dzinad commented Dec 16, 2022

No description provided.

@codecov
Copy link

codecov bot commented Dec 16, 2022

Codecov Report

Merging #6754 (f551592) into main (c8bc7ab) will increase coverage by 0.00%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #6754   +/-   ##
=========================================
  Coverage     72.54%   72.54%           
- Complexity     5521     5522    +1     
=========================================
  Files           772      772           
  Lines         29888    29899   +11     
  Branches       3531     3533    +2     
=========================================
+ Hits          21682    21691    +9     
  Misses         6793     6793           
- Partials       1413     1415    +2     
Impacted Files Coverage Δ
...x/navigation/ui/maps/building/BuildingProcessor.kt 72.22% <77.77%> (+4.22%) ⬆️

Comment on lines 79 to 80
val prevEVWaypointsCount = legWaypoints.take(legWaypointIndex + 1)
.count { it.isEVChargingWaypoint() }
Copy link
Contributor

@RingerJK RingerJK Dec 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit
it was hard to get the idea at the first glance. Up to you

Suggested change
val prevEVWaypointsCount = legWaypoints.take(legWaypointIndex + 1)
.count { it.isEVChargingWaypoint() }
val coordinateIdx = waypoints.map { it.isRequestedWaypoints }.indexOf(waypoints.map {it.isLegWaypoint }[legWaypointIndex])
return progress.navigationRoute.routeOptions.coordinatesList()
.getOrNull(coordinateIdx)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to use indexOf. In case the equality check of waypoints is broken or something. I know it sounds weird but it's less strict than counting the number of "bad" waypoints and subtracting them.
I rewrote it in terms of requested waypoints, nothing EV related remains.

@dzinad dzinad enabled auto-merge (rebase) December 16, 2022 12:49
@dzinad dzinad merged commit 483b635 into main Dec 16, 2022
@dzinad dzinad deleted the NAVAND-940-dd-2 branch December 16, 2022 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants