Fix irreflexive comparator in cvpcb auto-association sort
sortListbyCmpValue used >= 0, which returns true when comparing equal elements (Cmp returns 0 for equal strings). This violates the irreflexivity requirement of strict weak ordering, causing undefined behavior in std::sort.
This commit is contained in:
@@ -72,7 +72,7 @@ wxString GetQuotedText( wxString& text )
|
||||
// (m_ComponentValue member)
|
||||
bool sortListbyCmpValue( const FOOTPRINT_EQUIVALENCE& ref, const FOOTPRINT_EQUIVALENCE& test )
|
||||
{
|
||||
return ref.m_ComponentValue.Cmp( test.m_ComponentValue ) >= 0;
|
||||
return ref.m_ComponentValue.Cmp( test.m_ComponentValue ) > 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user