geometry: don't copy stuff in SHAPE_POLY_SET::GetRelativeIndices. Huge performance improvement for large polygons

This commit is contained in:
Tomasz Wlostowski 2020-04-13 16:49:30 +02:00
parent ee70c6dd5b
commit 9b2fbae706
1 changed files with 2 additions and 2 deletions

View File

@ -104,11 +104,11 @@ bool SHAPE_POLY_SET::GetRelativeIndices( int aGlobalIdx,
for( polygonIdx = 0; polygonIdx < OutlineCount(); polygonIdx++ )
{
const POLYGON currentPolygon = CPolygon( polygonIdx );
const POLYGON& currentPolygon = CPolygon( polygonIdx );
for( contourIdx = 0; contourIdx < currentPolygon.size(); contourIdx++ )
{
SHAPE_LINE_CHAIN currentContour = currentPolygon[contourIdx];
const SHAPE_LINE_CHAIN& currentContour = currentPolygon[contourIdx];
int totalPoints = currentContour.PointCount();
for( vertexIdx = 0; vertexIdx < totalPoints; vertexIdx++ )