pcbnew: Don't copy const structures when not needed
Copying the const pointer on large structures (filled zones) will be very slow and memory intensive. This can cause OOM on linux and extreme slowdowns when the save is triggered. Fixes: lp:1840168 * https://bugs.launchpad.net/kicad/+bug/1840168
This commit is contained in:
parent
7f54617dab
commit
72da23725a
|
@ -171,7 +171,7 @@ class SHAPE_POLY_SET : public SHAPE
|
|||
if( m_currentPolygon != m_poly->OutlineCount() - 1 )
|
||||
return false;
|
||||
|
||||
auto currentPolygon = m_poly->CPolygon( m_currentPolygon );
|
||||
const auto& currentPolygon = m_poly->CPolygon( m_currentPolygon );
|
||||
|
||||
return m_currentContour < (int) currentPolygon.size() - 1
|
||||
|| m_currentVertex < currentPolygon[m_currentContour].PointCount();
|
||||
|
|
Loading…
Reference in New Issue