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>2017-02-07 14:58:28 +0300
committerVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2017-02-07 14:58:28 +0300
commit7924ce5b212520dd6ef87b7c33998e84d97c67d7 (patch)
tree47f03064ad278196525b4dacf27b75dedb9b8235 /routing
parent803e85ea59f678002d58a2245211bb7c47e8e8d4 (diff)
OsrmMappingTypes refactoring.
Diffstat (limited to 'routing')
-rw-r--r--routing/osrm2feature_map.cpp5
-rw-r--r--routing/osrm2feature_map.hpp2
2 files changed, 4 insertions, 3 deletions
diff --git a/routing/osrm2feature_map.cpp b/routing/osrm2feature_map.cpp
index 8924a57ec1..0d51b4168e 100644
--- a/routing/osrm2feature_map.cpp
+++ b/routing/osrm2feature_map.cpp
@@ -59,8 +59,7 @@ bool FtSeg::Merge(FtSeg const & other)
if (other.m_fid != m_fid)
return false;
- bool const dir = other.m_pointEnd > other.m_pointStart;
- if (dir != (m_pointEnd > m_pointStart))
+ if (IsForward() != other.IsForward())
return false;
auto const s1 = min(m_pointStart, m_pointEnd);
@@ -72,7 +71,7 @@ bool FtSeg::Merge(FtSeg const & other)
{
m_pointStart = min(s1, s2);
m_pointEnd = max(e1, e2);
- if (!dir)
+ if (!other.IsForward())
swap(m_pointStart, m_pointEnd);
return true;
diff --git a/routing/osrm2feature_map.hpp b/routing/osrm2feature_map.hpp
index c487a0c6df..ec7e918161 100644
--- a/routing/osrm2feature_map.hpp
+++ b/routing/osrm2feature_map.hpp
@@ -57,6 +57,8 @@ namespace OsrmMappingTypes
bool IsIntersect(FtSeg const & other) const;
+ bool IsForward() const { return m_pointEnd > m_pointStart; }
+
bool IsValid() const
{
return m_fid != kInvalidFid;