Move accumulate_ch into process.
authorCarl Hetherington <cth@carlh.net>
Sun, 1 Oct 2023 21:43:43 +0000 (23:43 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 1 Oct 2023 21:43:43 +0000 (23:43 +0200)
src/leqm_nrt.cc

index e50a4210c3fceb42850fac7e21e4b4485ceaf5f2..ec10fe6669a861b8b89837dc4e3129ca4364d401 100644 (file)
@@ -84,13 +84,6 @@ public:
 
 
 private:
-       void accumulate_ch(std::vector<double>& ch_accumulator, std::vector<double> const& input_channel, int nsamples) const
-       {
-               for (auto i = 0; i < nsamples; i++) {
-                       ch_accumulator[i] += input_channel[i];
-               }
-       }
-
        std::vector<double> rectify(std::vector<double> const& input) const
        {
                std::vector<double> squared;
@@ -120,6 +113,12 @@ private:
 
        void process()
        {
+               auto accumulate_ch = [](std::vector<double>& ch_accumulator, std::vector<double> const& input_channel, int nsamples) {
+                       for (auto i = 0; i < nsamples; i++) {
+                               ch_accumulator[i] += input_channel[i];
+                       }
+               };
+
                /* Round-up in case _nsamples is not a multiple of _nch */
                int const frames = (_nsamples + _nch - 1) / _nch;