add some const keywords where applicable

This commit is contained in:
Dennis Luxen 2014-05-26 17:37:44 +02:00
parent f62515e13b
commit c35211b2f6
2 changed files with 4 additions and 9 deletions

View File

@ -562,7 +562,7 @@ class Contractor
{ {
Percent p(contractor_graph->GetNumberOfNodes()); Percent p(contractor_graph->GetNumberOfNodes());
SimpleLogger().Write() << "Getting edges of minimized graph"; SimpleLogger().Write() << "Getting edges of minimized graph";
NodeID number_of_nodes = contractor_graph->GetNumberOfNodes(); const NodeID number_of_nodes = contractor_graph->GetNumberOfNodes();
if (contractor_graph->GetNumberOfNodes()) if (contractor_graph->GetNumberOfNodes())
{ {
Edge new_edge; Edge new_edge;

View File

@ -133,7 +133,7 @@ class StaticRTree
inline float GetMinDist(const FixedPointCoordinate &location) const inline float GetMinDist(const FixedPointCoordinate &location) const
{ {
bool is_contained = Contains(location); const bool is_contained = Contains(location);
if (is_contained) if (is_contained)
{ {
return 0.; return 0.;
@ -734,18 +734,13 @@ class StaticRTree
result_phantom_node.location.lat = input_coordinate.lat; result_phantom_node.location.lat = input_coordinate.lat;
} }
float ratio = 0.f;
if (found_a_nearest_edge) if (found_a_nearest_edge)
{ {
const float distance_1 = FixedPointCoordinate::ApproximateEuclideanDistance( const float distance_1 = FixedPointCoordinate::ApproximateEuclideanDistance(
current_start_coordinate, result_phantom_node.location); current_start_coordinate, result_phantom_node.location);
const float distance_2 = FixedPointCoordinate::ApproximateEuclideanDistance( const float distance_2 = FixedPointCoordinate::ApproximateEuclideanDistance(
current_start_coordinate, current_end_coordinate); current_start_coordinate, current_end_coordinate);
const float ratio = std::min(1.f, distance_1 / distance_2);
ratio = distance_1 / distance_2;
ratio = std::min(1.f, ratio);
if (SPECIAL_NODEID != result_phantom_node.forward_node_id) if (SPECIAL_NODEID != result_phantom_node.forward_node_id)
{ {
@ -772,7 +767,7 @@ class StaticRTree
thread_local_rtree_stream->clear(std::ios::goodbit); thread_local_rtree_stream->clear(std::ios::goodbit);
SimpleLogger().Write(logDEBUG) << "Resetting stale filestream"; SimpleLogger().Write(logDEBUG) << "Resetting stale filestream";
} }
uint64_t seek_pos = sizeof(uint64_t) + leaf_id * sizeof(LeafNode); const uint64_t seek_pos = sizeof(uint64_t) + leaf_id * sizeof(LeafNode);
thread_local_rtree_stream->seekg(seek_pos); thread_local_rtree_stream->seekg(seek_pos);
thread_local_rtree_stream->read((char *)&result_node, sizeof(LeafNode)); thread_local_rtree_stream->read((char *)&result_node, sizeof(LeafNode));
} }