mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-13 17:53:11 +02:00
Don't pass large structures by value.
This commit is contained in:
parent
abba11031a
commit
8235843d01
@ -173,9 +173,10 @@ private:
|
||||
|
||||
|
||||
BACKGROUND_JOB_REPORTER::BACKGROUND_JOB_REPORTER( BACKGROUND_JOBS_MONITOR* aMonitor,
|
||||
std::shared_ptr<BACKGROUND_JOB> aJob ) :
|
||||
const std::shared_ptr<BACKGROUND_JOB>& aJob ) :
|
||||
PROGRESS_REPORTER_BASE( 1 ),
|
||||
m_monitor( aMonitor ), m_job( aJob )
|
||||
m_monitor( aMonitor ),
|
||||
m_job( aJob )
|
||||
{
|
||||
|
||||
}
|
||||
@ -305,10 +306,8 @@ void BACKGROUND_JOBS_MONITOR::ShowList( wxWindow* aParent, wxPoint aPos )
|
||||
|
||||
std::shared_lock<std::shared_mutex> lock( m_mutex, std::try_to_lock );
|
||||
|
||||
for( std::shared_ptr<BACKGROUND_JOB> job : m_jobs )
|
||||
{
|
||||
for( const std::shared_ptr<BACKGROUND_JOB>& job : m_jobs )
|
||||
list->Add( job );
|
||||
}
|
||||
|
||||
lock.unlock();
|
||||
|
||||
|
@ -404,12 +404,12 @@ void SCH_REFERENCE_LIST::ReannotateDuplicates( const SCH_REFERENCE_LIST& aAdditi
|
||||
}
|
||||
|
||||
|
||||
void SCH_REFERENCE_LIST::AnnotateByOptions( ANNOTATE_ORDER_T aSortOption,
|
||||
ANNOTATE_ALGO_T aAlgoOption,
|
||||
int aStartNumber,
|
||||
SCH_MULTI_UNIT_REFERENCE_MAP aLockedUnitMap,
|
||||
const SCH_REFERENCE_LIST& aAdditionalRefs,
|
||||
bool aStartAtCurrent )
|
||||
void SCH_REFERENCE_LIST::AnnotateByOptions( ANNOTATE_ORDER_T aSortOption,
|
||||
ANNOTATE_ALGO_T aAlgoOption,
|
||||
int aStartNumber,
|
||||
const SCH_MULTI_UNIT_REFERENCE_MAP& aLockedUnitMap,
|
||||
const SCH_REFERENCE_LIST& aAdditionalRefs,
|
||||
bool aStartAtCurrent )
|
||||
{
|
||||
switch( aSortOption )
|
||||
{
|
||||
@ -447,7 +447,7 @@ void SCH_REFERENCE_LIST::AnnotateByOptions( ANNOTATE_ORDER_T aSortOp
|
||||
|
||||
|
||||
void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int aStartNumber,
|
||||
SCH_MULTI_UNIT_REFERENCE_MAP aLockedUnitMap,
|
||||
const SCH_MULTI_UNIT_REFERENCE_MAP& aLockedUnitMap,
|
||||
const SCH_REFERENCE_LIST& aAdditionalRefs, bool aStartAtCurrent )
|
||||
{
|
||||
if ( m_flatList.size() == 0 )
|
||||
@ -508,15 +508,15 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
|
||||
continue;
|
||||
|
||||
// Check whether this symbol is in aLockedUnitMap.
|
||||
SCH_REFERENCE_LIST* lockedList = nullptr;
|
||||
const SCH_REFERENCE_LIST* lockedList = nullptr;
|
||||
|
||||
for( SCH_MULTI_UNIT_REFERENCE_MAP::value_type& pair : aLockedUnitMap )
|
||||
for( const SCH_MULTI_UNIT_REFERENCE_MAP::value_type& pair : aLockedUnitMap )
|
||||
{
|
||||
unsigned n_refs = pair.second.GetCount();
|
||||
|
||||
for( unsigned thisRefI = 0; thisRefI < n_refs; ++thisRefI )
|
||||
{
|
||||
SCH_REFERENCE &thisRef = pair.second[thisRefI];
|
||||
const SCH_REFERENCE &thisRef = pair.second[thisRefI];
|
||||
|
||||
if( thisRef.IsSameInstance( ref_unit ) )
|
||||
{
|
||||
@ -583,7 +583,7 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int
|
||||
|
||||
for( unsigned lockedRefI = 0; lockedRefI < n_refs; ++lockedRefI )
|
||||
{
|
||||
SCH_REFERENCE& lockedRef = ( *lockedList )[lockedRefI];
|
||||
const SCH_REFERENCE& lockedRef = ( *lockedList )[lockedRefI];
|
||||
|
||||
if( lockedRef.IsSameInstance( ref_unit ) )
|
||||
{
|
||||
|
@ -405,12 +405,12 @@ public:
|
||||
* @param aStartAtCurrent Use m_numRef for each reference as the start number (overrides
|
||||
* aStartNumber)
|
||||
*/
|
||||
void AnnotateByOptions( enum ANNOTATE_ORDER_T aSortOption,
|
||||
enum ANNOTATE_ALGO_T aAlgoOption,
|
||||
int aStartNumber,
|
||||
SCH_MULTI_UNIT_REFERENCE_MAP aLockedUnitMap,
|
||||
const SCH_REFERENCE_LIST& aAdditionalRefs,
|
||||
bool aStartAtCurrent );
|
||||
void AnnotateByOptions( enum ANNOTATE_ORDER_T aSortOption,
|
||||
enum ANNOTATE_ALGO_T aAlgoOption,
|
||||
int aStartNumber,
|
||||
const SCH_MULTI_UNIT_REFERENCE_MAP& aLockedUnitMap,
|
||||
const SCH_REFERENCE_LIST& aAdditionalRefs,
|
||||
bool aStartAtCurrent );
|
||||
|
||||
/**
|
||||
* Set the reference designators in the list that have not been annotated.
|
||||
@ -434,7 +434,7 @@ public:
|
||||
aStartNumber)
|
||||
*/
|
||||
void Annotate( bool aUseSheetNum, int aSheetIntervalId, int aStartNumber,
|
||||
SCH_MULTI_UNIT_REFERENCE_MAP aLockedUnitMap,
|
||||
const SCH_MULTI_UNIT_REFERENCE_MAP& aLockedUnitMap,
|
||||
const SCH_REFERENCE_LIST& aAdditionalRefs, bool aStartAtCurrent = false );
|
||||
|
||||
/**
|
||||
|
@ -45,8 +45,8 @@ class wxCloseEvent;
|
||||
class KICOMMON_API BACKGROUND_JOB_REPORTER : public PROGRESS_REPORTER_BASE
|
||||
{
|
||||
public:
|
||||
BACKGROUND_JOB_REPORTER( BACKGROUND_JOBS_MONITOR* aMonitor,
|
||||
std::shared_ptr<BACKGROUND_JOB> aJob );
|
||||
BACKGROUND_JOB_REPORTER( BACKGROUND_JOBS_MONITOR* aMonitor,
|
||||
const std::shared_ptr<BACKGROUND_JOB>& aJob );
|
||||
|
||||
void SetTitle( const wxString& aTitle ) override
|
||||
{
|
||||
|
@ -551,7 +551,7 @@ void CN_CONNECTIVITY_ALGO::Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter )
|
||||
}
|
||||
|
||||
|
||||
void CN_CONNECTIVITY_ALGO::LocalBuild( std::shared_ptr<CONNECTIVITY_DATA> aGlobalConnectivity,
|
||||
void CN_CONNECTIVITY_ALGO::LocalBuild( const std::shared_ptr<CONNECTIVITY_DATA>& aGlobalConnectivity,
|
||||
const std::vector<BOARD_ITEM*>& aLocalItems )
|
||||
{
|
||||
m_isLocal = true;
|
||||
|
@ -218,7 +218,7 @@ public:
|
||||
}
|
||||
|
||||
void Build( BOARD* aBoard, PROGRESS_REPORTER* aReporter = nullptr );
|
||||
void LocalBuild( std::shared_ptr<CONNECTIVITY_DATA> aGlobalConnectivity,
|
||||
void LocalBuild( const std::shared_ptr<CONNECTIVITY_DATA>& aGlobalConnectivity,
|
||||
const std::vector<BOARD_ITEM*>& aLocalItems );
|
||||
|
||||
void Clear();
|
||||
|
Loading…
x
Reference in New Issue
Block a user