From ea4b3877e29615ef683efa0dfb377039caa2ed46 Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Wed, 24 Oct 2012 13:59:37 -0500 Subject: [PATCH] move wxString constructor outside loop for speed --- pcbnew/kicad_plugin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index 2a7ada1e6c..410bb889cf 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -1054,18 +1054,18 @@ void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const if( m_board ) layerMask &= m_board->GetEnabledLayers(); + wxString layerName; + for( int layer = 0; layerMask; ++layer, layerMask >>= 1 ) { if( layerMask & 1 ) { - wxString layerName; - if( m_board ) layerName = m_board->GetLayerName( layer ); else layerName = BOARD::GetDefaultLayerName( layer, true ); - m_out->Print( 0, " %s", m_out->Quotew(layerName ).c_str() ); + m_out->Print( 0, " %s", m_out->Quotew( layerName ).c_str() ); } }