From cc5a42ff41163e6d8b8ddd3c71629e84cda4c41d Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 9 Jan 2020 22:55:46 +0000 Subject: [PATCH] Minor cleanup and performance. --- eeschema/dialogs/dialog_fields_editor_global.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/eeschema/dialogs/dialog_fields_editor_global.cpp b/eeschema/dialogs/dialog_fields_editor_global.cpp index b833f18018..153bd1c2f3 100644 --- a/eeschema/dialogs/dialog_fields_editor_global.cpp +++ b/eeschema/dialogs/dialog_fields_editor_global.cpp @@ -135,7 +135,7 @@ enum GROUP_TYPE struct DATA_MODEL_ROW { - DATA_MODEL_ROW( SCH_REFERENCE aFirstReference, GROUP_TYPE aType ) + DATA_MODEL_ROW( const SCH_REFERENCE& aFirstReference, GROUP_TYPE aType ) { m_Refs.push_back( aFirstReference ); m_Flag = aType; @@ -215,7 +215,7 @@ public: int GetNumberRows() override { return m_rows.size(); } // Columns are fieldNames + quantity column - int GetNumberCols() override { return m_fieldNames.size() + 1; } + int GetNumberCols() override { return (int) m_fieldNames.size() + 1; } wxString GetColLabelValue( int aCol ) override @@ -835,7 +835,7 @@ bool DIALOG_FIELDS_EDITOR_GLOBAL::TransferDataToWindow() std::vector references = m_dataModel->GetRowReferences( row ); bool found = false; - for( SCH_REFERENCE ref : references ) + for( const SCH_REFERENCE& ref : references ) { if( ref.GetComp() == component ) { @@ -888,9 +888,9 @@ void DIALOG_FIELDS_EDITOR_GLOBAL::AddField( const wxString& aName, m_config->Read( "SymbolFieldEditor/Show/" + aName, &defaultShow ); m_config->Read( "SymbolFieldEditor/GroupBy/" + aName, &defaultSortBy ); - fieldsCtrlRow.push_back( wxVariant( aName ) ); - fieldsCtrlRow.push_back( wxVariant( defaultShow ) ); - fieldsCtrlRow.push_back( wxVariant( defaultSortBy ) ); + fieldsCtrlRow.emplace_back( wxVariant( aName ) ); + fieldsCtrlRow.emplace_back( wxVariant( defaultShow ) ); + fieldsCtrlRow.emplace_back( wxVariant( defaultSortBy ) ); m_fieldsCtrl->AppendItem( fieldsCtrlRow ); }