From b73cc7db4a546114a660a8ad498686b997a792d0 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Thu, 15 Jun 2023 22:57:05 +0100 Subject: [PATCH] Fix a few accidental copies in loop iterators --- eeschema/connection_graph.cpp | 6 +++--- pcbnew/plugins/altium/altium_pcb.cpp | 8 ++++---- pcbnew/router/pns_shove.cpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/eeschema/connection_graph.cpp b/eeschema/connection_graph.cpp index 99053bf76c..0a0b241812 100644 --- a/eeschema/connection_graph.cpp +++ b/eeschema/connection_graph.cpp @@ -704,14 +704,14 @@ void CONNECTION_GRAPH::removeSubgraphs( std::set& aSubgrap std::sort( m_subgraphs.begin(), m_subgraphs.end() ); std::set codes_to_remove; - for( auto el : m_sheet_to_subgraphs_map ) + for( auto& el : m_sheet_to_subgraphs_map ) { std::sort( el.second.begin(), el.second.end() ); } for( CONNECTION_SUBGRAPH* sg : aSubgraphs ) { - for( auto it : sg->m_bus_neighbors ) + for( auto& it : sg->m_bus_neighbors ) { for( CONNECTION_SUBGRAPH* neighbor : it.second ) { @@ -730,7 +730,7 @@ void CONNECTION_GRAPH::removeSubgraphs( std::set& aSubgrap } } - for( auto it : sg->m_bus_parents ) + for( auto& it : sg->m_bus_parents ) { for( CONNECTION_SUBGRAPH* parent : it.second ) { diff --git a/pcbnew/plugins/altium/altium_pcb.cpp b/pcbnew/plugins/altium/altium_pcb.cpp index bdae8fc917..9290b9b7e1 100644 --- a/pcbnew/plugins/altium/altium_pcb.cpp +++ b/pcbnew/plugins/altium/altium_pcb.cpp @@ -2177,7 +2177,7 @@ void ALTIUM_PCB::ConvertArcs6ToBoardItem( const AARC6& aElem, const int aPrimiti ConvertArcs6ToBoardItemOnLayer( aElem, klayer ); } - for( const auto layerExpansionMask : + for( const auto& layerExpansionMask : HelperGetSolderAndPasteMaskExpansions( ALTIUM_RECORD::ARC, aPrimitiveIndex, aElem.layer ) ) { int width = aElem.width + ( layerExpansionMask.second * 2 ); @@ -2230,7 +2230,7 @@ void ALTIUM_PCB::ConvertArcs6ToFootprintItem( FOOTPRINT* aFootprint, const AARC6 } } - for( const auto layerExpansionMask : + for( const auto& layerExpansionMask : HelperGetSolderAndPasteMaskExpansions( ALTIUM_RECORD::ARC, aPrimitiveIndex, aElem.layer ) ) { int width = aElem.width + ( layerExpansionMask.second * 2 ); @@ -2873,7 +2873,7 @@ void ALTIUM_PCB::ConvertTracks6ToBoardItem( const ATRACK6& aElem, const int aPri } } - for( const auto layerExpansionMask : HelperGetSolderAndPasteMaskExpansions( + for( const auto& layerExpansionMask : HelperGetSolderAndPasteMaskExpansions( ALTIUM_RECORD::TRACK, aPrimitiveIndex, aElem.layer ) ) { int width = aElem.width + ( layerExpansionMask.second * 2 ); @@ -2927,7 +2927,7 @@ void ALTIUM_PCB::ConvertTracks6ToFootprintItem( FOOTPRINT* aFootprint, const ATR } } - for( const auto layerExpansionMask : HelperGetSolderAndPasteMaskExpansions( + for( const auto& layerExpansionMask : HelperGetSolderAndPasteMaskExpansions( ALTIUM_RECORD::TRACK, aPrimitiveIndex, aElem.layer ) ) { int width = aElem.width + ( layerExpansionMask.second * 2 ); diff --git a/pcbnew/router/pns_shove.cpp b/pcbnew/router/pns_shove.cpp index 6fc48db095..f2040538e2 100644 --- a/pcbnew/router/pns_shove.cpp +++ b/pcbnew/router/pns_shove.cpp @@ -178,7 +178,7 @@ SHOVE::~SHOVE() { std::unordered_set alreadyDeleted; - for( auto it : m_rootLineHistory ) + for( auto& it : m_rootLineHistory ) { auto it2 = alreadyDeleted.find( it.second );