router: replace large stack variables with std::array

This commit is contained in:
Tomasz Wlostowski 2021-02-23 22:48:30 +01:00
parent f7f5e67f56
commit 61e75a838b
1 changed files with 5 additions and 5 deletions

View File

@ -914,9 +914,9 @@ const LINE NODE::AssembleLine( LINKED_ITEM* aSeg, int* aOriginSegmentIndex,
{
const int MaxVerts = 1024 * 16;
VECTOR2I corners[MaxVerts + 1];
LINKED_ITEM* segs[MaxVerts + 1];
bool arcReversed[MaxVerts + 1];
std::array<VECTOR2I, MaxVerts + 1> corners;
std::array<LINKED_ITEM*, MaxVerts + 1> segs;
std::array<bool, MaxVerts + 1> arcReversed;
LINE pl;
bool guardHit = false;
@ -928,12 +928,12 @@ const LINE NODE::AssembleLine( LINKED_ITEM* aSeg, int* aOriginSegmentIndex,
pl.SetNet( aSeg->Net() );
pl.SetOwner( this );
followLine( aSeg, false, i_start, MaxVerts, corners, segs, arcReversed,
followLine( aSeg, false, i_start, MaxVerts, corners.data(), segs.data(), arcReversed.data(),
guardHit, aStopAtLockedJoints );
if( !guardHit )
{
followLine( aSeg, true, i_end, MaxVerts, corners, segs, arcReversed, guardHit,
followLine( aSeg, true, i_end, MaxVerts, corners.data(), segs.data(), arcReversed.data(), guardHit,
aStopAtLockedJoints );
}