aboutsummaryrefslogtreecommitdiff
path: root/mountain_pass
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-08-28 10:52:03 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-08-28 10:52:03 +0200
commitff57ebcbe4949b7b53e7c42ecc7916b601a67213 (patch)
tree84ee393c143514a5be849641a61add1930919dcc /mountain_pass
parent10806900a46b4eba197af9fc768928c57bd33982 (diff)
modernize
Diffstat (limited to 'mountain_pass')
-rw-r--r--mountain_pass/extract.go19
1 files changed, 7 insertions, 12 deletions
diff --git a/mountain_pass/extract.go b/mountain_pass/extract.go
index ccf8d06..712a3e1 100644
--- a/mountain_pass/extract.go
+++ b/mountain_pass/extract.go
@@ -7,6 +7,7 @@ import (
"io"
"log/slog"
"os"
+ "slices"
"strconv"
"strings"
@@ -168,23 +169,17 @@ func categorizePass(tags osm.Tags, highways []string) string {
natural := tags.Find("natural")
sport := tags.Find("sport")
isHikingNode := natural == "rock" || sport == "climbing"
- for _, h := range highways {
- if isRoadHighway(h) {
- return CategoryRoad
- }
+ if slices.ContainsFunc(highways, isRoadHighway) {
+ return CategoryRoad
}
if isHikingNode {
return CategoryHiking
}
- for _, h := range highways {
- if h == "track" {
- return CategoryTrack
- }
+ if slices.Contains(highways, "track") {
+ return CategoryTrack
}
- for _, h := range highways {
- if isPathHighway(h) {
- return CategoryPath
- }
+ if slices.ContainsFunc(highways, isPathHighway) {
+ return CategoryPath
}
return CategoryUnknown
}