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:
authorMikhail Gorbushin <m.gorbushin@corp.mail.ru>2019-03-22 16:10:26 +0300
committerVladimir Byko-Ianko <bykoianko@gmail.com>2019-03-25 16:40:52 +0300
commitac97784afd8254d2e724577c69c3d87749d5349b (patch)
treeab8884935abe9c96b5ebf9397b6679ba67ecef33 /routing
parent8ce28530301d6f891eef2ac948dabb09053f2a60 (diff)
[routing] review fixes
Diffstat (limited to 'routing')
-rw-r--r--routing/index_graph.cpp2
-rw-r--r--routing/index_graph_starter_joints.hpp15
-rw-r--r--routing/joint_segment.hpp3
3 files changed, 12 insertions, 8 deletions
diff --git a/routing/index_graph.cpp b/routing/index_graph.cpp
index 5b29af4c9e..3126522f49 100644
--- a/routing/index_graph.cpp
+++ b/routing/index_graph.cpp
@@ -2,6 +2,7 @@
#include "routing/restrictions_serialization.hpp"
#include "routing/routing_options.hpp"
+#include "routing/world_graph.hpp"
#include "platform/settings.hpp"
@@ -9,7 +10,6 @@
#include "base/checked_cast.hpp"
#include "base/exception.hpp"
-#include "routing/world_graph.hpp"
#include <algorithm>
#include <cstdlib>
diff --git a/routing/index_graph_starter_joints.hpp b/routing/index_graph_starter_joints.hpp
index d7b755e14a..2978fc1efe 100644
--- a/routing/index_graph_starter_joints.hpp
+++ b/routing/index_graph_starter_joints.hpp
@@ -1,11 +1,14 @@
#pragma once
+#include "routing/fake_feature_ids.hpp"
#include "routing/index_graph_starter.hpp"
#include "routing/joint_segment.hpp"
#include "routing/segment.hpp"
#include "geometry/point2d.hpp"
+#include "base/assert.hpp"
+
#include <limits>
#include <map>
#include <queue>
@@ -64,15 +67,15 @@ public:
// have got fake m_numMwmId during mwm generation.
bool IsRealSegment(Segment const & segment) const
{
- return segment.GetFeatureId() != std::numeric_limits<uint32_t>::max();
+ return segment.GetFeatureId() != FakeFeatureIds::kIndexGraphStarterId;
}
Segment const & GetSegmentOfFakeJoint(JointSegment const & joint, bool start);
private:
- static auto constexpr kInvisibleStartId = std::numeric_limits<uint32_t>::max() - 2;
- static auto constexpr kInvisibleEndId = std::numeric_limits<uint32_t>::max() - 1;
- static auto constexpr kInvalidId = std::numeric_limits<uint32_t>::max();
+ static auto constexpr kInvalidId = JointSegment::kInvalidId;
+ static auto constexpr kInvisibleEndId = kInvalidId - 1;
+ static auto constexpr kInvisibleStartId = kInvalidId - 2;
struct FakeJointSegment
{
@@ -243,7 +246,7 @@ std::vector<Segment> IndexGraphStarterJoints<Graph>::ReconstructJoint(JointSegme
if (IsInvisible(joint))
return {};
- // In case of a fake vertex we return its prebuild path.
+ // In case of a fake vertex we return its prebuilt path.
if (joint.IsFake())
{
auto const it = m_reconstructedFakeJoints.find(joint);
@@ -474,7 +477,7 @@ template <typename Graph>
std::vector<JointEdge> IndexGraphStarterJoints<Graph>::FindFirstJoints(Segment const & startSegment,
bool fromStart)
{
- Segment endSegment = fromStart ? m_endSegment : m_startSegment;
+ Segment const & endSegment = fromStart ? m_endSegment : m_startSegment;
std::queue<Segment> queue;
queue.push(startSegment);
diff --git a/routing/joint_segment.hpp b/routing/joint_segment.hpp
index 9655769c18..062945bb5b 100644
--- a/routing/joint_segment.hpp
+++ b/routing/joint_segment.hpp
@@ -15,6 +15,8 @@ namespace routing
class JointSegment
{
public:
+ static uint32_t constexpr kInvalidId = std::numeric_limits<uint32_t>::max();
+
JointSegment() = default;
JointSegment(Segment const & from, Segment const & to);
@@ -44,7 +46,6 @@ public:
}
private:
- static uint32_t constexpr kInvalidId = std::numeric_limits<uint32_t>::max();
uint32_t m_featureId = kInvalidId;
uint32_t m_startSegmentId = kInvalidId;
uint32_t m_endSegmentId = kInvalidId;