Connectivity optimizations

Don't copy the recursion test cache when copy-constructing
SCH_SHEET_PATHs as it's not needed in connectivity

Fix a few places that were copying unnecessarily
This commit is contained in:
Jon Evans
2020-07-08 17:42:12 -04:00
parent 741481591e
commit 282fcd5f3c
4 changed files with 37 additions and 5 deletions
+24
View File
@@ -103,6 +103,30 @@ SCH_SHEET_PATH::SCH_SHEET_PATH()
}
SCH_SHEET_PATH::SCH_SHEET_PATH( const SCH_SHEET_PATH& aOther )
{
initFromOther( aOther );
}
SCH_SHEET_PATH& SCH_SHEET_PATH::operator=( const SCH_SHEET_PATH& aOther )
{
initFromOther( aOther );
return *this;
}
void SCH_SHEET_PATH::initFromOther( const SCH_SHEET_PATH& aOther )
{
m_sheets = aOther.m_sheets;
m_pageNumber = aOther.m_pageNumber;
m_current_hash = aOther.m_current_hash;
// Note: don't copy m_recursion_test_cache as it is slow and we want SCH_SHEET_PATHS to be
// very fast to construct for use in the connectivity algorithm.
}
void SCH_SHEET_PATH::Rehash()
{
m_current_hash = 0;