From 7753ce8477e63187eb53e667d6bc4ed0ed0f5fc8 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Sun, 20 Jun 2021 14:44:09 +0200 Subject: [PATCH] Only iterate from path_b to path_new when intersecting --- src/dijkstragraph.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dijkstragraph.c b/src/dijkstragraph.c index 572a4a8..bb7e412 100644 --- a/src/dijkstragraph.c +++ b/src/dijkstragraph.c @@ -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