From 0f22fb596b271e959a9c1f3fd323efe8017c5597 Mon Sep 17 00:00:00 2001 From: artemp Date: Fri, 6 Feb 2015 17:13:41 +0100 Subject: [PATCH] enforce geometry_type const by removing ```inline geometry_type& get_geometry(std::size_t index)``` --- include/mapnik/feature.hpp | 5 ----- include/mapnik/memory_featureset.hpp | 2 +- src/memory_datasource.cpp | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/include/mapnik/feature.hpp b/include/mapnik/feature.hpp index 821d5c142..8418b0a78 100644 --- a/include/mapnik/feature.hpp +++ b/include/mapnik/feature.hpp @@ -219,11 +219,6 @@ public: return geom_cont_[index]; } - inline geometry_type& get_geometry(std::size_t index) - { - return geom_cont_[index]; - } - inline box2d envelope() const { // TODO - cache this diff --git a/include/mapnik/memory_featureset.hpp b/include/mapnik/memory_featureset.hpp index 1e7c9d541..85742f2cc 100644 --- a/include/mapnik/memory_featureset.hpp +++ b/include/mapnik/memory_featureset.hpp @@ -79,7 +79,7 @@ public: { for (std::size_t i=0; i<(*pos_)->num_geometries();++i) { - geometry_type & geom = (*pos_)->get_geometry(i); + geometry_type const& geom = (*pos_)->get_geometry(i); if (bbox_.intersects(::mapnik::envelope(geom))) { return *pos_++; diff --git a/src/memory_datasource.cpp b/src/memory_datasource.cpp index e832c4061..7d802aa73 100644 --- a/src/memory_datasource.cpp +++ b/src/memory_datasource.cpp @@ -49,7 +49,7 @@ struct accumulate_extent auto size = feat->num_geometries(); for (std::size_t i = 0; i < size; ++i) { - geometry_type & geom = feat->get_geometry(i); + geometry_type const& geom = feat->get_geometry(i); auto bbox = ::mapnik::envelope(geom); if ( first_ ) {