+ don't pass std::string arg by value - use const&

This commit is contained in:
artemp 2012-08-16 12:05:31 +01:00
parent e6e32fcb39
commit 8bba93d299
4 changed files with 6 additions and 6 deletions

View file

@ -32,7 +32,7 @@
using namespace boost::python; using namespace boost::python;
// help compiler see template definitions // help compiler see template definitions
static dict (*encode)( mapnik::grid const&, std::string, bool, unsigned int) = mapnik::grid_encode; static dict (*encode)( mapnik::grid const&, std::string const& , bool, unsigned int) = mapnik::grid_encode;
bool painted(mapnik::grid const& grid) bool painted(mapnik::grid const& grid)
{ {

View file

@ -34,7 +34,7 @@
using namespace boost::python; using namespace boost::python;
// help compiler see template definitions // help compiler see template definitions
static dict (*encode)( mapnik::grid_view const&, std::string, bool, unsigned int) = mapnik::grid_encode; static dict (*encode)( mapnik::grid_view const&, std::string const& , bool, unsigned int) = mapnik::grid_encode;
void export_grid_view() void export_grid_view()
{ {

View file

@ -342,7 +342,7 @@ void grid_encode_utf(T const& grid_type,
} }
template <typename T> template <typename T>
boost::python::dict grid_encode( T const& grid, std::string format, bool add_features, unsigned int resolution) boost::python::dict grid_encode( T const& grid, std::string const& format, bool add_features, unsigned int resolution)
{ {
if (format == "utf") { if (format == "utf") {
boost::python::dict json; boost::python::dict json;
@ -357,8 +357,8 @@ boost::python::dict grid_encode( T const& grid, std::string format, bool add_fea
} }
} }
template boost::python::dict grid_encode( mapnik::grid const& grid, std::string format, bool add_features, unsigned int resolution); template boost::python::dict grid_encode( mapnik::grid const& grid, std::string const& format, bool add_features, unsigned int resolution);
template boost::python::dict grid_encode( mapnik::grid_view const& grid, std::string format, bool add_features, unsigned int resolution); template boost::python::dict grid_encode( mapnik::grid_view const& grid, std::string const& format, bool add_features, unsigned int resolution);
/* new approach: key comes from grid object /* new approach: key comes from grid object
* grid size should be same as the map * grid size should be same as the map

View file

@ -64,7 +64,7 @@ void grid_encode_utf(T const& grid_type,
unsigned int resolution); unsigned int resolution);
template <typename T> template <typename T>
boost::python::dict grid_encode( T const& grid, std::string format, bool add_features, unsigned int resolution); boost::python::dict grid_encode( T const& grid, std::string const& format, bool add_features, unsigned int resolution);
/* new approach: key comes from grid object /* new approach: key comes from grid object
* grid size should be same as the map * grid size should be same as the map