Skip to content

Commit 991f86d

Browse files
fbanningmmiller-max
authored andcommitted
Avoid 1 (one) allocation
1 parent f02c026 commit 991f86d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/nearest_node.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function nearest_node(g::OSMGraph{U, T, W},
2121
cartesian_locations = LightOSM.to_cartesian(points)
2222
idxs, dists = knn(g.kdtree, cartesian_locations, n_neighbours, true)
2323
neighbours = [[g.index_to_node[j] for j in i] for i in idxs]
24-
dists = [d for d in dists]
24+
dists = collect(dists)
2525
return neighbours, dists
2626
end
2727

0 commit comments

Comments
 (0)