Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2019-05-07 11:36:35 +0300
committerVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2019-05-07 11:37:42 +0300
commitb185a76c4ec6e09589120dd475e9797d24ebe5ab (patch)
tree28196f58fcde283afefe6089e5126e093330c1cb /routing
parent96f736a9f3889b535a3a19c89e967781bb57fc2b (diff)
Adding a comment on multiplying by zero structure RouteWeight.
Diffstat (limited to 'routing')
-rw-r--r--routing/index_graph_starter.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/routing/index_graph_starter.cpp b/routing/index_graph_starter.cpp
index da2bf18fdc..2716f71afd 100644
--- a/routing/index_graph_starter.cpp
+++ b/routing/index_graph_starter.cpp
@@ -242,7 +242,11 @@ RouteWeight IndexGraphStarter::CalcSegmentWeight(Segment const & segment) const
auto const partLen = MercatorBounds::DistanceOnEarth(vertex.GetPointFrom(), vertex.GetPointTo());
auto const fullLen = MercatorBounds::DistanceOnEarth(GetPoint(real, false /* front */),
GetPoint(real, true /* front */));
- // Note. |fullLen| == 0.0 in case of Segment(s) with the same ends.
+ // Note 1. |fullLen| == 0.0 in case of Segment(s) with the same ends.
+ // Note 2. There is the following logic behind |return 0.0 * m_graph.CalcSegmentWeight(real);|:
+ // it's necessary to return a intance of the structure |RouteWeight| with zero wight.
+ // Theoretically it may be differ from |RouteWeight(0)| because some road access block
+ // may be kept in it and it is up to |RouteWeight| to know how to multiply by zero.
if (fullLen == 0.0)
return 0.0 * m_graph.CalcSegmentWeight(real);