Small correction to Peak; expand and fix tests

This commit is contained in:
Chris Cannam
2022-06-09 09:03:20 +01:00
parent 75b1c9abb5
commit 6257457320
2 changed files with 106 additions and 20 deletions

View File

@@ -98,9 +98,11 @@ public:
int np = i;
if (j < nPeaks) {
np = m_locations[j];
} else if (nPeaks > 0) {
np = m_locations[nPeaks-1];
}
if (next) {
if (pp == i) {
if (pp == i || j >= nPeaks) {
next[i] = i;
} else {
next[i] = np;