mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 15:33:44 +03:00
Speed up cell drawing in Lyon, where logs about leaking out of the boundary happens frequently
This commit is contained in:
parent
a421eaf900
commit
0f0384949d
@ -87,6 +87,7 @@ impl RenderCellsBuilder {
|
||||
);
|
||||
|
||||
// Initially fill out the grid based on the roads in each cell
|
||||
let mut warn_leak = true;
|
||||
for (cell_idx, cell) in neighborhood.cells.iter().enumerate() {
|
||||
for (r, interval) in &cell.roads {
|
||||
let road = map.get_r(*r);
|
||||
@ -111,10 +112,15 @@ impl RenderCellsBuilder {
|
||||
//
|
||||
// Example is https://www.openstreetmap.org/way/87298633
|
||||
if grid_idx >= grid.data.len() {
|
||||
warn!(
|
||||
"{} leaks outside its neighborhood's boundary polygon, near {}",
|
||||
road.id, pt
|
||||
);
|
||||
if warn_leak {
|
||||
warn!(
|
||||
"{} leaks outside its neighborhood's boundary polygon, near {}",
|
||||
road.id, pt
|
||||
);
|
||||
// In some neighborhoods, there are so many warnings that logging
|
||||
// causes noticeable slowdown!
|
||||
warn_leak = false;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user