remove type from more structs, remove asserts

This commit is contained in:
Emil Tin 2014-08-20 07:54:39 +02:00 committed by Emil Tin
parent 1e40cd6f0b
commit 2e3d33dfcd
6 changed files with 2 additions and 17 deletions

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -13,7 +13,7 @@ struct NodeBasedEdgeData
{
NodeBasedEdgeData()
: distance(INVALID_EDGE_WEIGHT), edgeBasedNodeID(SPECIAL_NODEID),
nameID(std::numeric_limits<unsigned>::max()), type(std::numeric_limits<short>::max()),
nameID(std::numeric_limits<unsigned>::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::vector<ImportEdge
edge.data.roundabout = import_edge.roundabout;
edge.data.ignore_in_grid = import_edge.in_tiny_cc;
edge.data.nameID = import_edge.name_id;
edge.data.type = import_edge.type;
edge.data.isAccessRestricted = import_edge.access_restricted;
edge.data.travel_mode = import_edge.travel_mode;

View File

@ -330,7 +330,6 @@ void ExtractionContainers::PrepareData(const std::string &output_file_name,
edge_iterator->source_coordinate.lon != std::numeric_limits<int>::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;

View File

@ -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())