Skip to content

Commit 486c3a2

Browse files
committedApr 23, 2018
Apply clazy optimisation to orthogonalize algorithm
1 parent 59c9b97 commit 486c3a2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/core/geometry/qgsinternalgeometryengine.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,12 @@ QgsLineString *doOrthogonalize( QgsLineString *ring, int iterations, double tole
389389

390390
std::unique_ptr< QgsLineString > best( ring->clone() );
391391

392+
QVector< QgsVector > /* yep */ motions;
393+
motions.reserve( numPoints );
394+
392395
for ( int it = 0; it < iterations; ++it )
393396
{
394-
QVector< QgsVector > /* yep */ motions;
395-
motions.reserve( numPoints );
397+
motions.resize( 0 ); // avoid re-allocations
396398

397399
// first loop through an calculate all motions
398400
QgsPoint a;

0 commit comments

Comments
 (0)
Please sign in to comment.