From 1ecf3f0889e2daf3f84879e6733fb9abac395c1a Mon Sep 17 00:00:00 2001 From: artemp Date: Mon, 9 Feb 2015 13:46:01 +0100 Subject: [PATCH] use const ref when iterating over geometries in feature --- include/mapnik/hit_test_filter.hpp | 2 +- include/mapnik/renderer_common/process_polygon_symbolizer.hpp | 2 +- src/agg/process_line_symbolizer.cpp | 4 ++-- src/agg/process_polygon_pattern_symbolizer.cpp | 2 +- src/cairo/process_polygon_pattern_symbolizer.cpp | 2 +- src/svg/output/process_symbolizers.cpp | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/mapnik/hit_test_filter.hpp b/include/mapnik/hit_test_filter.hpp index cfc915ff4..156bb2c34 100644 --- a/include/mapnik/hit_test_filter.hpp +++ b/include/mapnik/hit_test_filter.hpp @@ -40,7 +40,7 @@ public: bool pass(feature_impl & feature) { - for (geometry_type & geom : feature.paths()) + for (geometry_type const& geom : feature.paths()) { vertex_adapter va(geom); if (label::hit_test(va, x_,y_,tol_)) diff --git a/include/mapnik/renderer_common/process_polygon_symbolizer.hpp b/include/mapnik/renderer_common/process_polygon_symbolizer.hpp index fecff3585..f831b8780 100644 --- a/include/mapnik/renderer_common/process_polygon_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_polygon_symbolizer.hpp @@ -58,7 +58,7 @@ void render_polygon_symbolizer(polygon_symbolizer const &sym, if (simplify_tolerance > 0.0) converter.template set(); // optional simplify converter if (smooth > 0.0) converter.template set(); // optional smooth converter - for (geometry_type & geom : feature.paths()) + for (geometry_type const& geom : feature.paths()) { if (geom.size() > 2) { diff --git a/src/agg/process_line_symbolizer.cpp b/src/agg/process_line_symbolizer.cpp index 23b9389f0..8ebbf0737 100644 --- a/src/agg/process_line_symbolizer.cpp +++ b/src/agg/process_line_symbolizer.cpp @@ -178,7 +178,7 @@ void agg_renderer::process(line_symbolizer const& sym, if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter - for (geometry_type & geom : feature.paths()) + for (geometry_type const& geom : feature.paths()) { if (geom.size() > 1) { @@ -206,7 +206,7 @@ void agg_renderer::process(line_symbolizer const& sym, converter.set(); converter.set(); //always stroke - for (geometry_type & geom : feature.paths()) + for (geometry_type const& geom : feature.paths()) { if (geom.size() > 1) { diff --git a/src/agg/process_polygon_pattern_symbolizer.cpp b/src/agg/process_polygon_pattern_symbolizer.cpp index 72fb144e5..6e4211254 100644 --- a/src/agg/process_polygon_pattern_symbolizer.cpp +++ b/src/agg/process_polygon_pattern_symbolizer.cpp @@ -168,7 +168,7 @@ void agg_renderer::process(polygon_pattern_symbolizer const& sym, if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter - for ( geometry_type & geom : feature.paths()) + for ( geometry_type const& geom : feature.paths()) { if (geom.size() > 2) { diff --git a/src/cairo/process_polygon_pattern_symbolizer.cpp b/src/cairo/process_polygon_pattern_symbolizer.cpp index 71454e2ae..b20d6bd99 100644 --- a/src/cairo/process_polygon_pattern_symbolizer.cpp +++ b/src/cairo/process_polygon_pattern_symbolizer.cpp @@ -112,7 +112,7 @@ void cairo_renderer::process(polygon_pattern_symbolizer const& sym, if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter - for ( geometry_type & geom : feature.paths()) + for ( geometry_type const& geom : feature.paths()) { if (geom.size() > 2) { diff --git a/src/svg/output/process_symbolizers.cpp b/src/svg/output/process_symbolizers.cpp index a2ebc8987..aab9d777c 100644 --- a/src/svg/output/process_symbolizers.cpp +++ b/src/svg/output/process_symbolizers.cpp @@ -97,7 +97,7 @@ bool svg_renderer::process(rule::symbolizers const& syms, if (process_path) { // generate path output for each geometry of the current feature. - for (auto & geom : feature.paths()) + for (auto const& geom : feature.paths()) { if(geom.size() > 0) {