Fix more for loops making copies of iterates

This commit is contained in:
Ian McInerney 2022-09-25 00:45:59 +01:00
parent 1683e552f7
commit 44c2782d39
4 changed files with 4 additions and 4 deletions

View File

@ -105,7 +105,7 @@ void DIALOG_MIGRATE_BUSES::updateUi()
m_migration_list->InsertColumn( 2, _( "New Label" ) );
m_migration_list->InsertColumn( 3, _( "Status" ) );
for( auto item : m_items )
for( auto& item : m_items )
{
wxString old = item.labels[0];
for( unsigned j = 1; j < item.labels.size(); j++ )

View File

@ -767,7 +767,7 @@ void SCH_EAGLE_PLUGIN::loadSchematic( wxXmlNode* aSchematicNode )
{
const SCH_SYMBOL* origSymbol = cmp.second.cmp;
for( auto unitEntry : cmp.second.units )
for( auto& unitEntry : cmp.second.units )
{
if( unitEntry.second == false )
continue; // unit has been already processed

View File

@ -1377,7 +1377,7 @@ void SCH_LEGACY_PLUGIN_CACHE::SaveSymbol( LIB_SYMBOL* aSymbol, OUTPUTFORMATTER&
if( aMap )
{
for( auto entry : *aMap )
for( auto& entry : *aMap )
{
LIB_SYMBOL* symbol = entry.second;

View File

@ -1029,7 +1029,7 @@ bool SYMBOL_LIBRARY_MANAGER::LIB_BUFFER::SaveBuffer( std::shared_ptr<SYMBOL_BUFF
aLibTable->SaveSymbol( m_libName, parentSymbol );
for( auto entry : derivedSymbols )
for( auto& entry : derivedSymbols )
{
std::shared_ptr<SYMBOL_BUFFER> symbol = GetBuffer( entry );