diff --git a/pcbnew/connectivity/connectivity_algo.h b/pcbnew/connectivity/connectivity_algo.h index 34ab7f9ba1..41507af18f 100644 --- a/pcbnew/connectivity/connectivity_algo.h +++ b/pcbnew/connectivity/connectivity_algo.h @@ -146,7 +146,7 @@ public: m_items.push_back( aItem ); } - const std::list GetItems() const + const std::list& GetItems() const { return m_items; } diff --git a/pcbnew/connectivity/connectivity_data.cpp b/pcbnew/connectivity/connectivity_data.cpp index f7c219df66..88a59cb545 100644 --- a/pcbnew/connectivity/connectivity_data.cpp +++ b/pcbnew/connectivity/connectivity_data.cpp @@ -695,9 +695,9 @@ static int getMinDist( BOARD_CONNECTED_ITEM* aItem, const VECTOR2I& aPoint ) } -bool CONNECTIVITY_DATA::TestTrackEndpointDangling( PCB_TRACK* aTrack, VECTOR2I* aPos ) +bool CONNECTIVITY_DATA::TestTrackEndpointDangling( PCB_TRACK* aTrack, VECTOR2I* aPos ) const { - std::list items = GetConnectivityAlgo()->ItemEntry( aTrack ).GetItems(); + const std::list& items = GetConnectivityAlgo()->ItemEntry( aTrack ).GetItems(); // Not in the connectivity system. This is a bug! if( items.empty() ) diff --git a/pcbnew/connectivity/connectivity_data.h b/pcbnew/connectivity/connectivity_data.h index 3e06b2cd5f..8f9a1288cf 100644 --- a/pcbnew/connectivity/connectivity_data.h +++ b/pcbnew/connectivity/connectivity_data.h @@ -229,7 +229,7 @@ public: void RunOnUnconnectedEdges( std::function aFunc ); - bool TestTrackEndpointDangling( PCB_TRACK* aTrack, VECTOR2I* aPos = nullptr ); + bool TestTrackEndpointDangling( PCB_TRACK* aTrack, VECTOR2I* aPos = nullptr ) const; /** * Function ClearLocalRatsnest()