From 6880687f002e823727a2e1ddc2f6d75106b1f83e Mon Sep 17 00:00:00 2001 From: John Beard Date: Wed, 30 Jan 2019 09:12:10 +0000 Subject: [PATCH] Geom: interate ClipperLib::Path by reference ClipperLib::Path is std::vector. Iterating this with "for( auto point : path)" could result in 'n' IntPoint copy-constructions. It does seem GCC 8, at least, manages to optimise these constructions out. Replace with the "standard" for( const auto& point : path) idiom. --- include/geometry/shape_line_chain.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/geometry/shape_line_chain.h b/include/geometry/shape_line_chain.h index da6dbee215..795d0012e0 100644 --- a/include/geometry/shape_line_chain.h +++ b/include/geometry/shape_line_chain.h @@ -132,7 +132,7 @@ public: { m_points.reserve( aPath.size() ); - for( auto point : aPath ) + for( const auto& point : aPath ) m_points.emplace_back( point.X, point.Y ); }