From c66f67ac0748216fb8b1d39c74b094308d0e1f9c Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Wed, 3 May 2017 23:40:09 +0200 Subject: [PATCH] Updated assertions to catch negative duration values for weights > 0 but still clamping negative duration values at 0 without checking weights --- include/engine/guidance/assemble_steps.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/engine/guidance/assemble_steps.hpp b/include/engine/guidance/assemble_steps.hpp index ee3771cb5..ce0076117 100644 --- a/include/engine/guidance/assemble_steps.hpp +++ b/include/engine/guidance/assemble_steps.hpp @@ -222,11 +222,12 @@ inline std::vector assembleSteps(const datafacade::BaseDataFacade &fa // u-------------v // | |---------| source_weight // | |---| target_weight + BOOST_ASSERT(target_weight >= source_weight); const EdgeWeight weight = target_weight - source_weight; - BOOST_ASSERT(weight >= 0); // use rectified linear unit function to avoid negative duration values // due to flooring errors in phantom snapping + BOOST_ASSERT(target_duration >= source_duration || weight == 0); const EdgeWeight duration = std::max(0, target_duration - source_duration); steps.push_back(RouteStep{source_node.name_id,