From fd6c70afe14aa13cbb606f97cfe00a843a8439a6 Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Sat, 21 Feb 2015 14:54:29 +0100 Subject: [PATCH] Fix regression in sub-matching length check --- routing_algorithms/map_matching.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routing_algorithms/map_matching.hpp b/routing_algorithms/map_matching.hpp index 2f1e618c1..71d8686dd 100644 --- a/routing_algorithms/map_matching.hpp +++ b/routing_algorithms/map_matching.hpp @@ -526,7 +526,7 @@ template class MapMatching final } // matchings that only consist of one candidate are invalid - if (parent_timestamp_index - sub_matching_begin < 2) + if (parent_timestamp_index - sub_matching_begin + 1 < 2) { sub_matching_begin = sub_matching_end; continue; @@ -554,6 +554,7 @@ template class MapMatching final reconstructed_indices.emplace_front(parent_timestamp_index, parent_candidate_index); if (reconstructed_indices.size() < 2) { + sub_matching_begin = sub_matching_end; continue; }