Don't pick a name with a longer path to override with
Only triggered on some platforms because of compiler-dependent unordered_set iteration Fixes https://gitlab.com/kicad/code/kicad/-/issues/7169
This commit is contained in:
parent
eb80ac464a
commit
6cd4fcf30c
|
@ -1834,23 +1834,28 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph )
|
||||||
{
|
{
|
||||||
for( CONNECTION_SUBGRAPH* subgraph : visited )
|
for( CONNECTION_SUBGRAPH* subgraph : visited )
|
||||||
{
|
{
|
||||||
|
if( subgraph == original )
|
||||||
|
continue;
|
||||||
|
|
||||||
CONNECTION_SUBGRAPH::PRIORITY priority =
|
CONNECTION_SUBGRAPH::PRIORITY priority =
|
||||||
CONNECTION_SUBGRAPH::GetDriverPriority( subgraph->m_driver );
|
CONNECTION_SUBGRAPH::GetDriverPriority( subgraph->m_driver );
|
||||||
|
|
||||||
bool candidateStrong = ( priority >= CONNECTION_SUBGRAPH::PRIORITY::HIER_LABEL );
|
bool candidateStrong = ( priority >= CONNECTION_SUBGRAPH::PRIORITY::HIER_LABEL );
|
||||||
wxString candidateName = subgraph->m_driver_connection->Name();
|
wxString candidateName = subgraph->m_driver_connection->Name();
|
||||||
|
bool shorterPath = subgraph->m_sheet.size() < original->m_sheet.size();
|
||||||
|
bool asGoodPath = subgraph->m_sheet.size() <= original->m_sheet.size();
|
||||||
|
|
||||||
// Pick a better driving subgraph if it:
|
// Pick a better driving subgraph if it:
|
||||||
// a) has a power pin or global driver
|
// a) has a power pin or global driver
|
||||||
// b) is a strong driver and we're a weak driver
|
// b) is a strong driver and we're a weak driver
|
||||||
// c) meets or exceeds our priority, is a strong driver, and has a shorter path
|
// c) meets or exceeds our priority, is a strong driver, and has a shorter path
|
||||||
// d) is weak, we're week, and is alphabetically lower
|
// d) matches our strength and is at least as short, and is alphabetically lower
|
||||||
|
|
||||||
if( ( priority >= CONNECTION_SUBGRAPH::PRIORITY::POWER_PIN ) ||
|
if( ( priority >= CONNECTION_SUBGRAPH::PRIORITY::POWER_PIN ) ||
|
||||||
( !originalStrong && candidateStrong ) ||
|
( !originalStrong && candidateStrong ) ||
|
||||||
( priority >= highest && candidateStrong &&
|
( priority >= highest && candidateStrong && shorterPath ) ||
|
||||||
subgraph->m_sheet.size() < original->m_sheet.size() ) ||
|
( ( originalStrong == candidateStrong ) && asGoodPath &&
|
||||||
( ( originalStrong == candidateStrong ) && candidateName < originalName ) )
|
( candidateName < originalName ) ) )
|
||||||
{
|
{
|
||||||
original = subgraph;
|
original = subgraph;
|
||||||
highest = priority;
|
highest = priority;
|
||||||
|
|
Loading…
Reference in New Issue