1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-03 09:09:47 +02:00

Bug1754: Telephone and AM Radio curves should not flatten...

... Problem was a wrongly implemented comparator for wxArray Sort().

The array of points was not really sorted, and results differed with repeated
calls to Sort().

Unlike with std::sort, these comparators are supposed to be trichotomous.

Problem dates to commit 7d5e54e364fcccd630274f2658703543d8c596eb

See also commit 4a500c77dda5592468f931db0c791236679157b4
This commit is contained in:
Paul Licameli 2018-01-18 14:46:49 -05:00
parent f8be26a9b8
commit 9f2ff354f6

View File

@ -265,7 +265,12 @@ private:
static int wxCMPFUNC_CONV SortCurvePoints (EQPoint **p0, EQPoint **p1)
{
return (*p0)->Freq > (*p1)->Freq;
auto diff = (*p0)->Freq - (*p1)->Freq;
if (diff < 0)
return -1;
if (diff > 0)
return 1;
return 0;
}
#ifdef EXPERIMENTAL_EQ_SSE_THREADED