do not consider empty-names + empty-refs a valid name for u-turns
This commit is contained in:
parent
4bf3c97476
commit
e197dae54d
@ -1096,5 +1096,5 @@ Feature: Collapse
|
|||||||
| be | residential | cross | no | |
|
| be | residential | cross | no | |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| waypoints | route | turns |
|
| waypoints | route | turns |
|
||||||
| a,f | road,, | depart,continue uturn,arrive |
|
| a,f | road,cross,, | depart,turn left,on ramp left,arrive |
|
||||||
|
@ -121,9 +121,14 @@ inline bool haveSameMode(const RouteStep &first, const RouteStep &second, const
|
|||||||
// alias for readability
|
// alias for readability
|
||||||
inline bool haveSameName(const RouteStep &lhs, const RouteStep &rhs)
|
inline bool haveSameName(const RouteStep &lhs, const RouteStep &rhs)
|
||||||
{
|
{
|
||||||
|
const auto has_name_or_ref = [](auto const& step) {
|
||||||
|
return !step.name.empty() || !step.ref.empty();
|
||||||
|
};
|
||||||
|
|
||||||
// make sure empty is not involved
|
// make sure empty is not involved
|
||||||
if (lhs.name_id == EMPTY_NAMEID || rhs.name_id == EMPTY_NAMEID)
|
if (!has_name_or_ref(lhs) || !has_name_or_ref(rhs)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// easy check to not go over the strings if not necessary
|
// easy check to not go over the strings if not necessary
|
||||||
else if (lhs.name_id == rhs.name_id)
|
else if (lhs.name_id == rhs.name_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user