From 04688c256f1d1eaae909b0a115af46723be20c09 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 16 Sep 2018 23:58:08 +0100 Subject: [PATCH 2/2] Use resize() instead of reserve()/fill() so hardeners don't choke. MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.15.2 (Apple Git-101.1)" This is a multi-part message in MIME format. --------------2.15.2 (Apple Git-101.1) Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit Fixes: lp:1789283 * https://bugs.launchpad.net/kicad/+bug/1789283 --- pcbnew/autorouter/ar_autoplacer.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) --------------2.15.2 (Apple Git-101.1) Content-Type: text/x-patch; name="0002-Use-resize-instead-of-reserve-fill-so-hardeners-don-.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0002-Use-resize-instead-of-reserve-fill-so-hardeners-don-.patch" diff --git a/pcbnew/autorouter/ar_autoplacer.cpp b/pcbnew/autorouter/ar_autoplacer.cpp index b68044f57..5d85137f7 100644 --- a/pcbnew/autorouter/ar_autoplacer.cpp +++ b/pcbnew/autorouter/ar_autoplacer.cpp @@ -224,8 +224,7 @@ int AR_AUTOPLACER::propagate() const uint32_t NO_CELL_ZONE = CELL_IS_HOLE | CELL_IS_EDGE | CELL_IS_ZONE; - pt_cell_V.reserve( std::max( m_matrix.m_Nrows, m_matrix.m_Ncols ) ); - fill( pt_cell_V.begin(), pt_cell_V.end(), 0 ); + pt_cell_V.resize( std::max( m_matrix.m_Nrows, m_matrix.m_Ncols ), CELL_IS_EMPTY ); // Search from left to right and top to bottom. for( row = 0; row < m_matrix.m_Nrows; row++ ) @@ -251,7 +250,7 @@ int AR_AUTOPLACER::propagate() } // Search from right to left and top to bottom/ - fill( pt_cell_V.begin(), pt_cell_V.end(), 0 ); + fill( pt_cell_V.begin(), pt_cell_V.end(), CELL_IS_EMPTY ); for( row = 0; row < m_matrix.m_Nrows; row++ ) { @@ -276,7 +275,7 @@ int AR_AUTOPLACER::propagate() } // Search from bottom to top and right to left. - fill( pt_cell_V.begin(), pt_cell_V.end(), 0 ); + fill( pt_cell_V.begin(), pt_cell_V.end(), CELL_IS_EMPTY ); for( col = m_matrix.m_Ncols - 1; col >= 0; col-- ) { @@ -301,7 +300,7 @@ int AR_AUTOPLACER::propagate() } // Search from bottom to top and left to right. - fill( pt_cell_V.begin(), pt_cell_V.end(), 0 ); + fill( pt_cell_V.begin(), pt_cell_V.end(), CELL_IS_EMPTY ); for( col = 0; col < m_matrix.m_Ncols; col++ ) { --------------2.15.2 (Apple Git-101.1)--