From 76032e62fbaab6f104142be6c6f9a940a92e6361 Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Thu, 18 Jul 2019 17:41:13 +0300 Subject: [PATCH] [routing] Review fixes. --- routing/fake_vertex.hpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/routing/fake_vertex.hpp b/routing/fake_vertex.hpp index a71517571e..703e601863 100644 --- a/routing/fake_vertex.hpp +++ b/routing/fake_vertex.hpp @@ -10,6 +10,7 @@ #include #include +#include #include namespace routing @@ -32,19 +33,14 @@ public: bool operator==(FakeVertex const & rhs) const { - return m_numMwmId == rhs.m_numMwmId && m_from == rhs.m_from && m_to == rhs.m_to && - m_type == rhs.m_type; + return std::tie(m_numMwmId, m_from, m_to, m_type) == + std::tie(rhs.m_numMwmId, rhs.m_from, rhs.m_to, rhs.m_type); } bool operator<(FakeVertex const & rhs) const { - if (m_numMwmId != rhs.m_numMwmId) - return m_numMwmId < rhs.m_numMwmId; - if (m_from != rhs.m_from) - return m_from < rhs.m_from; - if (m_to != rhs.m_to) - return m_to < rhs.m_to; - return m_type < rhs.m_type; + return std::tie(m_numMwmId, m_from, m_to, m_type) < + std::tie(rhs.m_numMwmId, rhs.m_from, rhs.m_to, rhs.m_type); } Junction const & GetJunctionFrom() const { return m_from; }