From b3db6572e887dd0459edcb5a52d6128fd2d944b6 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sun, 24 Jun 2018 13:22:21 -0700 Subject: [PATCH] pcbnew: diff pair filter bugfix Added required action on the std::remove_if construct to erase elements matching the filter --- pcbnew/router/pns_diff_pair.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pcbnew/router/pns_diff_pair.cpp b/pcbnew/router/pns_diff_pair.cpp index e603f196e2..0fb5daf754 100644 --- a/pcbnew/router/pns_diff_pair.cpp +++ b/pcbnew/router/pns_diff_pair.cpp @@ -400,10 +400,12 @@ bool DP_GATEWAYS::checkDiagonalAlignment( const VECTOR2I& a, const VECTOR2I& b ) void DP_GATEWAYS::FilterByOrientation ( int aAngleMask, DIRECTION_45 aRefOrientation ) { - std::remove_if( m_gateways.begin(), m_gateways.end(), [aAngleMask, aRefOrientation]( const DP_GATEWAY& dp) { - DIRECTION_45 orient( dp.AnchorP() - dp.AnchorN() ); - return !( orient.Angle( aRefOrientation ) & aAngleMask ); - } ); + m_gateways.erase( + std::remove_if( m_gateways.begin(), m_gateways.end(), [aAngleMask, aRefOrientation]( const DP_GATEWAY& dp) { + DIRECTION_45 orient( dp.AnchorP() - dp.AnchorN() ); + return !( orient.Angle( aRefOrientation ) & aAngleMask ); + } ), m_gateways.end() + ); } static VECTOR2I makeGapVector( VECTOR2I dir, int length )