From 1fe848f37ce93256f73a2df1b5c4bc75354fd8b5 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 4 Jun 2019 13:49:11 +0100 Subject: [PATCH] Minor performance enhancements. --- eeschema/dialogs/dialog_migrate_buses.cpp | 7 ++++--- eeschema/dialogs/dialog_migrate_buses.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/eeschema/dialogs/dialog_migrate_buses.cpp b/eeschema/dialogs/dialog_migrate_buses.cpp index 9d68d18e72..057f21ac5f 100644 --- a/eeschema/dialogs/dialog_migrate_buses.cpp +++ b/eeschema/dialogs/dialog_migrate_buses.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include /** @@ -122,13 +123,13 @@ void DIALOG_MIGRATE_BUSES::updateUi() } -std::vector DIALOG_MIGRATE_BUSES::getProposedLabels( std::vector aLabelList ) +std::vector DIALOG_MIGRATE_BUSES::getProposedLabels( const std::vector& aLabelList ) { int lowest_start = INT_MAX; int highest_end = -1; int widest_bus = -1; - for( auto label : aLabelList ) + for( const wxString& label : aLabelList ) { SCH_CONNECTION conn; conn.ConfigureFromLabel( label ); @@ -149,7 +150,7 @@ std::vector DIALOG_MIGRATE_BUSES::getProposedLabels( std::vector proposals; - for( auto label : aLabelList ) + for( const wxString& label : aLabelList ) { conn.ConfigureFromLabel( label ); wxString proposal = conn.VectorPrefix(); diff --git a/eeschema/dialogs/dialog_migrate_buses.h b/eeschema/dialogs/dialog_migrate_buses.h index f2999e28fa..856394fa2d 100644 --- a/eeschema/dialogs/dialog_migrate_buses.h +++ b/eeschema/dialogs/dialog_migrate_buses.h @@ -59,7 +59,7 @@ private: void updateUi(); - std::vector getProposedLabels( std::vector aLabelList ); + std::vector getProposedLabels( const std::vector& aLabelList ); void onItemSelected( wxListEvent& aEvent );