From 59ca59d431bc6f4eaf72a75ff6c11ae49a912b81 Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Sun, 3 Feb 2013 13:19:23 +0100 Subject: [PATCH] Using unordered_set where it suffices --- Contractor/EdgeBasedGraphFactory.cpp | 12 +++--------- Contractor/EdgeBasedGraphFactory.h | 7 ++++--- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Contractor/EdgeBasedGraphFactory.cpp b/Contractor/EdgeBasedGraphFactory.cpp index 4126cff01..e484a25e6 100644 --- a/Contractor/EdgeBasedGraphFactory.cpp +++ b/Contractor/EdgeBasedGraphFactory.cpp @@ -44,18 +44,12 @@ EdgeBasedGraphFactory::EdgeBasedGraphFactory(int nodes, std::vector edges; - // edges.reserve( 2 * inputEdges.size() ); + _NodeBasedEdge edge; for ( std::vector< NodeBasedEdge >::const_iterator i = inputEdges.begin(); i != inputEdges.end(); ++i ) { - - _NodeBasedEdge edge; if(!i->isForward()) { edge.source = i->target(); edge.target = i->source(); diff --git a/Contractor/EdgeBasedGraphFactory.h b/Contractor/EdgeBasedGraphFactory.h index 0b909b264..12c6c198b 100644 --- a/Contractor/EdgeBasedGraphFactory.h +++ b/Contractor/EdgeBasedGraphFactory.h @@ -35,7 +35,8 @@ #include #include #include - +#include +#include #include "../typedefs.h" #include "../DataStructures/DeallocatingVector.h" @@ -103,8 +104,8 @@ public: } speedProfile; private: boost::shared_ptr<_NodeBasedDynamicGraph> _nodeBasedGraph; - boost::unordered_map _barrierNodes; - boost::unordered_map _trafficLights; + boost::unordered_set _barrierNodes; + boost::unordered_set _trafficLights; typedef std::pair RestrictionSource; typedef std::pair RestrictionTarget;