Browse Source

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.
pull/22/head
Seth Hillbrand 4 months ago
parent
commit
788716490a
  1. 2
      cvpcb/auto_associate.cpp

2
cvpcb/auto_associate.cpp

@ -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;
}

Loading…
Cancel
Save