pcbnew: code style cleanup

This commit is contained in:
Seth Hillbrand 2019-01-12 07:24:00 -08:00
parent 69d90a4e84
commit 576261cad1
1 changed files with 8 additions and 12 deletions

View File

@ -1023,12 +1023,9 @@ void PNS_KICAD_IFACE::SyncWorld( PNS::NODE *aWorld )
{ {
for( auto pad : module->Pads() ) for( auto pad : module->Pads() )
{ {
std::unique_ptr< PNS::SOLID > solid = syncPad( pad ); if( auto solid = syncPad( pad ) )
if( solid )
aWorld->Add( std::move( solid ) ); aWorld->Add( std::move( solid ) );
worstPadClearance = std::max( worstPadClearance, pad->GetLocalClearance() ); worstPadClearance = std::max( worstPadClearance, pad->GetLocalClearance() );
} }
@ -1055,16 +1052,15 @@ void PNS_KICAD_IFACE::SyncWorld( PNS::NODE *aWorld )
{ {
KICAD_T type = t->Type(); KICAD_T type = t->Type();
if( type == PCB_TRACE_T ) { if( type == PCB_TRACE_T )
std::unique_ptr< PNS::SEGMENT > segment = syncTrack( t ); {
if( segment ) { if( auto segment = syncTrack( t ) )
aWorld->Add( std::move( segment ) ); aWorld->Add( std::move( segment ) );
} }
} else if( type == PCB_VIA_T ) { else if( type == PCB_VIA_T )
std::unique_ptr< PNS::VIA > via = syncVia( static_cast<VIA*>( t ) ); {
if( via ) { if( auto via = syncVia( static_cast<VIA*>( t ) ) )
aWorld->Add( std::move( via ) ); aWorld->Add( std::move( via ) );
}
} }
} }