diff data/model/FFTModel.cpp @ 1569:c2c8e071e24f

Comment
author Chris Cannam
date Wed, 07 Nov 2018 15:46:20 +0000
parents 36b4872e894a
children 5fe24e4af12c
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();