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:
authorgmoryes <m.gorbushin@corp.mail.ru>2019-05-13 12:39:11 +0300
committerGitHub <noreply@github.com>2019-05-13 12:39:11 +0300
commite23e6e0138d4dee51344609b85985212b7e685d4 (patch)
tree46113ece70a7f99094d380076be75a844333a071 /routing
parent7231460be2605c7005d14447fcd4890ec0049328 (diff)
parentb185a76c4ec6e09589120dd475e9797d24ebe5ab (diff)
Merge pull request #10845 from bykoianko/master-comment-on-0-mult-wight
[routing] 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);