From fdc59209cfa60566a5ee3b914c023c99c905a527 Mon Sep 17 00:00:00 2001 From: Kajari Ghosh Date: Wed, 25 Apr 2018 11:08:22 -0400 Subject: [PATCH] fix the ascii art to make sense --- .../routing_algorithms/many_to_many_ch.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/engine/routing_algorithms/many_to_many_ch.cpp b/src/engine/routing_algorithms/many_to_many_ch.cpp index f35854998c7..8ee02b5ec92 100644 --- a/src/engine/routing_algorithms/many_to_many_ch.cpp +++ b/src/engine/routing_algorithms/many_to_many_ch.cpp @@ -286,12 +286,13 @@ void calculateDistances(typename SearchEngineData::ManyToManyQuer } else { + // there is no shortcut to unpack. source and target are on the same EBG Node. + // if the offset of the target is greater than the offset of the source, subtract it if (target_phantom.GetForwardDistance() > source_phantom.GetForwardDistance()) { - // ............ <-- calculateEGBAnnotation returns distance from 0 to 3 - // ->s -->t <-- offsets - // --..........++++ <-- subtract source offset and add target offset - // .............. <-- want this distance as result + // --------->t <-- offsets + // ->s <-- subtract source offset from target offset + // ......... <-- want this distance as result // entry 0---1---2---3--- <-- 3 is exit node EdgeDistance offset = target_phantom.GetForwardDistance() - source_phantom.GetForwardDistance(); @@ -299,10 +300,9 @@ void calculateDistances(typename SearchEngineData::ManyToManyQuer } else { - // ............ <-- calculateEGBAnnotation returns distance from 0 to 3 - // s<--------<--t <-- GetReverseDistance() returns this offset - // ---.........++++ <-- subtract source offset and add target offset - // ............. <-- want this distance as result + // s<--- <-- offsets + // t<--------- <-- subtract source offset from target offset + // ...... <-- want this distance as result // entry 0---1---2---3--- <-- 3 is exit node EdgeDistance offset = target_phantom.GetReverseDistance() - source_phantom.GetReverseDistance();