diff --git a/libs/kimath/src/geometry/shape_poly_set.cpp b/libs/kimath/src/geometry/shape_poly_set.cpp index b1a87f4f73..4525d4a535 100644 --- a/libs/kimath/src/geometry/shape_poly_set.cpp +++ b/libs/kimath/src/geometry/shape_poly_set.cpp @@ -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++ )