From db092c828e09e55570e5f1ac15dd63a8735f2012 Mon Sep 17 00:00:00 2001 From: "Daniel J. Hofmann" Date: Tue, 8 Sep 2015 23:34:20 +0200 Subject: [PATCH] Don't pass by const-value for a read-only view. I can't see a reason we pass by const-value here. Note: changes API because of the `route_parameters` header. --- data_structures/route_parameters.cpp | 2 +- data_structures/static_rtree.hpp | 4 ++-- include/osrm/route_parameters.hpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data_structures/route_parameters.cpp b/data_structures/route_parameters.cpp index cac9de30d..df23ce25a 100644 --- a/data_structures/route_parameters.cpp +++ b/data_structures/route_parameters.cpp @@ -134,7 +134,7 @@ void RouteParameters::addCoordinate( static_cast(COORDINATE_PRECISION * boost::fusion::at_c<1>(received_coordinates))); } -void RouteParameters::getCoordinatesFromGeometry(const std::string geometry_string) +void RouteParameters::getCoordinatesFromGeometry(const std::string &geometry_string) { PolylineCompressor pc; coordinates = pc.decode_string(geometry_string); diff --git a/data_structures/static_rtree.hpp b/data_structures/static_rtree.hpp index bd88226ab..07cd490c0 100644 --- a/data_structures/static_rtree.hpp +++ b/data_structures/static_rtree.hpp @@ -345,8 +345,8 @@ class StaticRTree // Construct a packed Hilbert-R-Tree with Kamel-Faloutsos algorithm [1] explicit StaticRTree(const std::vector &input_data_vector, - const std::string tree_node_filename, - const std::string leaf_node_filename, + const std::string &tree_node_filename, + const std::string &leaf_node_filename, const std::vector &coordinate_list) : m_element_count(input_data_vector.size()), m_leaf_node_filename(leaf_node_filename) { diff --git a/include/osrm/route_parameters.hpp b/include/osrm/route_parameters.hpp index 5e16b919f..6395ad685 100644 --- a/include/osrm/route_parameters.hpp +++ b/include/osrm/route_parameters.hpp @@ -79,7 +79,7 @@ struct RouteParameters void addCoordinate(const boost::fusion::vector &received_coordinates); - void getCoordinatesFromGeometry(const std::string geometry_string); + void getCoordinatesFromGeometry(const std::string &geometry_string); short zoom_level; bool print_instructions;