Skip to content

Commit

Permalink
Return early from the restriction check loop
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelabon committed Jun 4, 2024
1 parent 53ba13c commit f618385
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1120,18 +1120,17 @@ boolean isRestricted(Way currentWay, Way previousWay, Node commonNode) {
else if (rel.hasTag("type", "restriction") && rel.hasKey("restriction"))
return false;
else {
boolean remove = true;
String routeValue = relation.get("route");
for (String s : restrictions) {
if (s.length() <= 12)
continue;
String sub = s.substring(12);
if (routeValue.equals(sub) && rel.hasTag("type", s))
remove = false;
return false;
else if (routeValue.equals(sub) && rel.hasKey("restriction:" + sub))
remove = false;
return false;
}
return remove;
return true;
}
});

Expand Down

0 comments on commit f618385

Please sign in to comment.