From 2e3d33dfcd7dae130591acbaf35eda0c34c6e3df Mon Sep 17 00:00:00 2001 From: Emil Tin Date: Wed, 20 Aug 2014 07:54:39 +0200 Subject: [PATCH] remove type from more structs, remove asserts --- Contractor/EdgeBasedGraphFactory.cpp | 1 - DataStructures/ImportEdge.cpp | 4 +--- DataStructures/ImportEdge.h | 2 -- DataStructures/NodeBasedGraph.h | 4 +--- Extractor/ExtractionContainers.cpp | 1 - Util/GraphLoader.h | 7 ------- 6 files changed, 2 insertions(+), 17 deletions(-) diff --git a/Contractor/EdgeBasedGraphFactory.cpp b/Contractor/EdgeBasedGraphFactory.cpp index e54d10a52..6ac7ccd97 100644 --- a/Contractor/EdgeBasedGraphFactory.cpp +++ b/Contractor/EdgeBasedGraphFactory.cpp @@ -504,7 +504,6 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedNodes() } BOOST_ASSERT(u < v); - BOOST_ASSERT(edge_data.type != SHRT_MAX); // Note: edges that end on barrier nodes or on a turn restriction // may actually be in two distinct components. We choose the smallest diff --git a/DataStructures/ImportEdge.cpp b/DataStructures/ImportEdge.cpp index 8d4c9df07..b59d6149c 100644 --- a/DataStructures/ImportEdge.cpp +++ b/DataStructures/ImportEdge.cpp @@ -52,17 +52,15 @@ NodeBasedEdge::NodeBasedEdge(NodeID source, EdgeWeight weight, bool forward, bool backward, - short type, bool roundabout, bool in_tiny_cc, bool access_restricted, TravelMode travel_mode, bool is_split) - : source(source), target(target), name_id(name_id), weight(weight), type(type), + : source(source), target(target), name_id(name_id), weight(weight), forward(forward), backward(backward), roundabout(roundabout), in_tiny_cc(in_tiny_cc), access_restricted(access_restricted), is_split(is_split), travel_mode(travel_mode) { - BOOST_ASSERT_MSG(type > 0, "negative edge type"); } bool EdgeBasedEdge::operator<(const EdgeBasedEdge &other) const diff --git a/DataStructures/ImportEdge.h b/DataStructures/ImportEdge.h index a6945f237..4ccbee6d9 100644 --- a/DataStructures/ImportEdge.h +++ b/DataStructures/ImportEdge.h @@ -41,7 +41,6 @@ struct NodeBasedEdge EdgeWeight weight, bool forward, bool backward, - short type, bool roundabout, bool in_tiny_cc, bool access_restricted, @@ -52,7 +51,6 @@ struct NodeBasedEdge NodeID target; NodeID name_id; EdgeWeight weight; - short type; bool forward : 1; bool backward : 1; bool roundabout : 1; diff --git a/DataStructures/NodeBasedGraph.h b/DataStructures/NodeBasedGraph.h index a4d521411..14b5432d9 100644 --- a/DataStructures/NodeBasedGraph.h +++ b/DataStructures/NodeBasedGraph.h @@ -13,7 +13,7 @@ struct NodeBasedEdgeData { NodeBasedEdgeData() : distance(INVALID_EDGE_WEIGHT), edgeBasedNodeID(SPECIAL_NODEID), - nameID(std::numeric_limits::max()), type(std::numeric_limits::max()), + nameID(std::numeric_limits::max()), isAccessRestricted(false), shortcut(false), forward(false), backward(false), roundabout(false), ignore_in_grid(false), travel_mode(TRAVEL_MODE_INACCESSIBLE) { @@ -22,7 +22,6 @@ struct NodeBasedEdgeData int distance; unsigned edgeBasedNodeID; unsigned nameID; - short type; bool isAccessRestricted : 1; bool shortcut : 1; bool forward : 1; @@ -91,7 +90,6 @@ NodeBasedDynamicGraphFromImportEdges(int number_of_nodes, std::vectorsource_coordinate.lon != std::numeric_limits::min()) { BOOST_ASSERT(edge_iterator->speed != -1); - BOOST_ASSERT(edge_iterator->type >= 0); edge_iterator->target_coordinate.lat = node_iterator->lat; edge_iterator->target_coordinate.lon = node_iterator->lon; diff --git a/Util/GraphLoader.h b/Util/GraphLoader.h index bea08c0ea..c211a5bce 100644 --- a/Util/GraphLoader.h +++ b/Util/GraphLoader.h @@ -126,7 +126,6 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream, edge_list.reserve(m); EdgeWeight weight; - short type; NodeID nameID; int length; bool is_roundabout, ignore_in_grid, is_access_restricted, is_split; @@ -160,8 +159,6 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream, forward = false; } - BOOST_ASSERT(type >= 0); - // translate the external NodeIDs to internal IDs auto internal_id_iter = ext_to_int_id_map.find(source); if (ext_to_int_id_map.find(source) == ext_to_int_id_map.end()) @@ -195,7 +192,6 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream, weight, forward, backward, - type, is_roundabout, ignore_in_grid, is_access_restricted, @@ -302,7 +298,6 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream, edge_list.reserve(m); EdgeWeight weight; - short type; NodeID nameID; int length; bool is_roundabout, ignore_in_grid, is_access_restricted, is_split; @@ -326,8 +321,6 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream, BOOST_ASSERT_MSG(weight > 0, "loaded null weight"); BOOST_ASSERT_MSG(0 <= dir && dir <= 2, "loaded bogus direction"); - BOOST_ASSERT(type >= 0); - // translate the external NodeIDs to internal IDs auto internal_id_iter = ext_to_int_id_map.find(source); if (ext_to_int_id_map.find(source) == ext_to_int_id_map.end())