diff --git a/DataStructures/RestrictionMap.cpp b/DataStructures/RestrictionMap.cpp index afb8b2c76..1859b8287 100644 --- a/DataStructures/RestrictionMap.cpp +++ b/DataStructures/RestrictionMap.cpp @@ -153,8 +153,7 @@ void RestrictionMap::FixupStartingTurnRestriction(const NodeID node_u, // Check if edge (u, v) is the start of any turn restriction. // If so returns id of first target node. -NodeID RestrictionMap::CheckForEmanatingIsOnlyTurn(const NodeID node_u, - const NodeID node_v) const +NodeID RestrictionMap::CheckForEmanatingIsOnlyTurn(const NodeID node_u, const NodeID node_v) const { BOOST_ASSERT(node_u != SPECIAL_NODEID); BOOST_ASSERT(node_v != SPECIAL_NODEID); @@ -204,7 +203,7 @@ bool RestrictionMap::CheckIfTurnIsRestricted(const NodeID node_u, for (const RestrictionTarget &restriction_target : bucket) { if ((node_w == restriction_target.target_node) && // target found - (!restriction_target.is_only) // and not an only_-restr. + (!restriction_target.is_only) // and not an only_-restr. ) { return true; diff --git a/DataStructures/RestrictionMap.h b/DataStructures/RestrictionMap.h index 9ac18e787..8207b8038 100644 --- a/DataStructures/RestrictionMap.h +++ b/DataStructures/RestrictionMap.h @@ -39,16 +39,16 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include - struct RestrictionSource { NodeID start_node; NodeID via_node; - RestrictionSource(NodeID start, NodeID via) - : start_node(start), via_node(via) {} + RestrictionSource(NodeID start, NodeID via) : start_node(start), via_node(via) + { + } - friend inline bool operator==(const RestrictionSource& lhs, const RestrictionSource& rhs) + friend inline bool operator==(const RestrictionSource &lhs, const RestrictionSource &rhs) { return (lhs.start_node == rhs.start_node && lhs.via_node == rhs.via_node); } @@ -59,10 +59,11 @@ struct RestrictionTarget NodeID target_node; bool is_only; - explicit RestrictionTarget(NodeID target, bool only) - : target_node(target), is_only(only) {} + explicit RestrictionTarget(NodeID target, bool only) : target_node(target), is_only(only) + { + } - friend inline bool operator==(const RestrictionTarget& lhs, const RestrictionTarget& rhs) + friend inline bool operator==(const RestrictionTarget &lhs, const RestrictionTarget &rhs) { return (lhs.target_node == rhs.target_node && lhs.is_only == rhs.is_only); } @@ -70,21 +71,21 @@ struct RestrictionTarget namespace std { - template <> struct hash +template <> struct hash +{ + size_t operator()(const RestrictionSource &r_source) const { - size_t operator()(const RestrictionSource &r_source) const - { - return hash_val(r_source.start_node, r_source.via_node); - } - }; + return hash_val(r_source.start_node, r_source.via_node); + } +}; - template <> struct hash +template <> struct hash +{ + size_t operator()(const RestrictionTarget &r_target) const { - size_t operator()(const RestrictionTarget &r_target) const - { - return hash_val(r_target.target_node, r_target.is_only); - } - }; + return hash_val(r_target.target_node, r_target.is_only); + } +}; } /** @@ -102,7 +103,10 @@ class RestrictionMap NodeID CheckForEmanatingIsOnlyTurn(const NodeID u, const NodeID v) const; bool CheckIfTurnIsRestricted(const NodeID u, const NodeID v, const NodeID w) const; bool IsViaNode(const NodeID node) const; - unsigned size() { return m_count; } + unsigned size() + { + return m_count; + } private: bool IsSourceNode(const NodeID node) const;