Only iterate from path_b to path_new when intersecting

This commit is contained in:
Markus Koch 2021-06-20 14:44:09 +02:00
parent 6ffee116c7
commit 7753ce8477

View File

@ -374,8 +374,7 @@ int dijkstra_path_intersect(struct dijkstra_solver *solver,
path_new->destination,
path_new->net_meta->type);
// TODO: I don't have to iterate over the *entire* array here, it should be enough to only iterate over the entries after path_b.
dijkstra_path_intersect_all(solver, path_new, path_new); // Since straight paths can only cross once, we don't need to check any newly created entries.
dijkstra_path_intersect_all(solver, path_b, path_new); // Since straight paths can only cross once, we don't need to check any newly created entries.
}
// Now do the same thing for path b