From aabba5f7c761f9193b68d19ed4fc4de2affd4d2c Mon Sep 17 00:00:00 2001
From: Romain BERNARD <romain.bernard@uca.fr>
Date: Mon, 24 Jun 2024 10:11:00 +0200
Subject: [PATCH] fix a silly iteration issue bug

---
 src/routes/vehicle/SAEVRoute.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/routes/vehicle/SAEVRoute.cpp b/src/routes/vehicle/SAEVRoute.cpp
index 95d9b8a..0f194d7 100644
--- a/src/routes/vehicle/SAEVRoute.cpp
+++ b/src/routes/vehicle/SAEVRoute.cpp
@@ -410,8 +410,8 @@ BestInsertionQueue SAEVRoute::getBestInsertionsQueue(size_t requestId, size_t ve
                                       originInsertionKeyPoint, destinationInsertionKeyPoint)) {
                 score = getDetourScore(requestId, *originInsertionKeyPoint, *destinationInsertionKeyPoint);
                 bestInsertionQueue.emplace(originInsertionKeyPoint, destinationInsertionKeyPoint, score);
-                destinationInsertionKeyPoint = destinationInsertionKeyPoint->getSuccessor();
             }
+            destinationInsertionKeyPoint = destinationInsertionKeyPoint->getSuccessor();
         }
 
         //Iterate over possible origins and reset destination to being the same point as the origin
-- 
GitLab