File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 66#include < numeric>
77
88constexpr int PREDICTIVE_MEASUREMENTS = 30 ; // 3s
9- constexpr int PREDICTIVE_TIME_MS = 1000 ;
9+ constexpr double PREDICTIVE_TIME_MS = 1000.0 ;
1010
1111class Process {
1212 public:
@@ -230,8 +230,11 @@ class GrindProcess : public Process {
230230 }
231231
232232 double volumePerSecond () const {
233- double sum = std::accumulate (measurements.begin (), measurements.end (), 0 );
234- return sum / measurements.size () * (1000.0 / PROGRESS_INTERVAL);
233+ double sum = 0.0 ;
234+ for (const auto n : measurements) {
235+ sum += n;
236+ }
237+ return sum / static_cast <double >(measurements.size ()) * (1000.0 / static_cast <double >(PROGRESS_INTERVAL));
235238 }
236239
237240 void updateVolume (double volume) override { currentVolume = volume; };
You can’t perform that action at this time.
0 commit comments