changeset 1569:c2c8e071e24f

Comment
author Chris Cannam
date Wed, 07 Nov 2018 15:46:20 +0000
parents 2b532ff7f22e
children 410819150cd3
files data/model/FFTModel.cpp
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/data/model/FFTModel.cpp	Wed Nov 07 15:46:10 2018 +0000
+++ b/data/model/FFTModel.cpp	Wed Nov 07 15:46:20 2018 +0000
@@ -126,7 +126,9 @@
 float
 FFTModel::getMagnitudeAt(int x, int y) const
 {
-    if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) return 0.f;
+    if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) {
+        return 0.f;
+    }
     auto col = getFFTColumn(x);
     return abs(col[y]);
 }
@@ -318,7 +320,7 @@
     // spectrograms where values from two consecutive columns are
     // needed at once. This cache gets essentially no hits when
     // scrolling through a magnitude spectrogram, but 95%+ hits with a
-    // peak-frequency spectrogram.
+    // peak-frequency spectrogram or spectrum.
     for (const auto &incache : m_cached) {
         if (incache.n == n) {
             inSmallCache.hit();