Skip to content

Commit e1642ad

Browse files
authored
Replace getkey with get
1 parent 6442955 commit e1642ad

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/parse.jl

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ function maxspeed(tags::AbstractDict)::DEFAULT_OSM_MAXSPEED_TYPE
2929
end
3030
else
3131
highway_type = get(tags, "highway", "other")
32-
key = getkey(DEFAULT_MAXSPEEDS[], highway_type, "other")
33-
return U(DEFAULT_MAXSPEEDS[][key])
32+
value = get(() -> DEFAULT_MAXSPEEDS[]["other"], DEFAULT_MAXSPEEDS[], highway_type)
33+
return U(value)
3434
end
3535
end
3636

@@ -55,8 +55,8 @@ function lanes(tags::AbstractDict)::DEFAULT_OSM_LANES_TYPE
5555
end
5656
else
5757
highway_type = get(tags, "highway", "other")
58-
key = getkey(DEFAULT_LANES[], highway_type, "other")
59-
return U(DEFAULT_LANES[][key])
58+
value = get(() -> DEFAULT_LANES[]["other"], DEFAULT_LANES[], highway_type)
59+
return U(value)
6060
end
6161
end
6262

@@ -80,8 +80,8 @@ function is_oneway(tags::AbstractDict)::Bool
8080
return true
8181
else
8282
highway_type = get(tags, "highway", "other")
83-
key = getkey(DEFAULT_ONEWAY, highway_type, "other")
84-
return DEFAULT_ONEWAY[key]
83+
value = get(() -> DEFAULT_ONEWAY["other"], DEFAULT_ONEWAY, highway_type)
84+
return value
8585
end
8686
end
8787

0 commit comments

Comments
 (0)