From ab08175be33be73549461992f5f0d947177c5aaf Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Mon, 5 Aug 2019 10:29:42 +0300 Subject: [PATCH] [routing] IndexGraph::IsJointOrEnd() optimization. --- routing/index_graph.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routing/index_graph.cpp b/routing/index_graph.cpp index fad981a824..02dea24d07 100644 --- a/routing/index_graph.cpp +++ b/routing/index_graph.cpp @@ -53,8 +53,11 @@ bool IndexGraph::IsJointOrEnd(Segment const & segment, bool fromStart) // For features, that ends out of mwm. In this case |m_graph.IsJoint| returns false, but we should // think, that it's Joint anyway. uint32_t const pointId = segment.GetPointId(fromStart); + if (pointId == 0) + return true; + uint32_t const pointsNumber = GetGeometry().GetRoad(segment.GetFeatureId()).GetPointsCount(); - return pointId == 0 || pointId + 1 == pointsNumber; + return pointId + 1 == pointsNumber; } void IndexGraph::GetEdgeList(Segment const & segment, bool isOutgoing, vector & edges,