Clean up ExportAnalysis code

* only zero limiter_pk array on initialization
  (other data is explicitly initialized)
* resize peak-data vector to at least 800 bins
This commit is contained in:
Robin Gareus 2022-12-26 14:34:25 +01:00
parent 7b3cbaf68f
commit 140b373cac
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 5 additions and 5 deletions

View File

@ -53,7 +53,7 @@ public:
width = std::max<size_t> (800, width);
peaks.resize (2);
peaks[0].resize (w);
peaks[0].resize (width);
peaks[1].resize (width);
spectrum.resize (width);
@ -61,9 +61,9 @@ public:
spectrum[i].resize (b);
}
lgraph_i = new float[width]();
lgraph_s = new float[width]();
lgraph_m = new float[width]();
lgraph_i = new float[width];
lgraph_s = new float[width];
lgraph_m = new float[width];
limiter_pk = new float[width]();
for (size_t i = 0; i < width; ++i) {
@ -96,7 +96,7 @@ public:
lgraph_i = new float[width];
lgraph_s = new float[width];
lgraph_m = new float[width];
limiter_pk = new float[width]();
limiter_pk = new float[width];
truepeakpos[0] = other.truepeakpos[0];
truepeakpos[1] = other.truepeakpos[1];