mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 07:25:47 +03:00
Fix some zero-length paths in the parking efficiency layer. #329
This commit is contained in:
parent
0fc4c04171
commit
4beff2b7bf
@ -410,7 +410,13 @@ impl Efficiency {
|
||||
for (car_pt, dist) in timer
|
||||
.parallelize("calculate paths", Parallelism::Fastest, requests, |req| {
|
||||
let car_pt = req.start.pt(map);
|
||||
map.pathfind(req).map(|path| (car_pt, path.total_length()))
|
||||
// TODO Walking paths should really return some indication of "zero length
|
||||
// path" for this
|
||||
if req.start == req.end {
|
||||
Some((car_pt, Distance::ZERO))
|
||||
} else {
|
||||
map.pathfind(req).map(|path| (car_pt, path.total_length()))
|
||||
}
|
||||
})
|
||||
.into_iter()
|
||||
.flatten()
|
||||
|
Loading…
Reference in New Issue
Block a user