Geom: interate ClipperLib::Path by reference

ClipperLib::Path is std::vector<IntPoint>. 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.
This commit is contained in:
John Beard 2019-01-30 09:12:10 +00:00 committed by jean-pierre charras
parent 9a41fd060b
commit 6880687f00
1 changed files with 1 additions and 1 deletions

View File

@ -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 );
}