| 9 | namespace { |
| 10 | |
| 11 | static float calculateAverage(span<const float> bins) { |
| 12 | if (bins.size() == 0) { |
| 13 | return 0.0f; |
| 14 | } |
| 15 | |
| 16 | float sum = 0.0f; |
| 17 | for (size i = 0; i < bins.size(); ++i) { |
| 18 | sum += bins[i]; |
| 19 | } |
| 20 | return sum / static_cast<float>(bins.size()); |
| 21 | } |
| 22 | |
| 23 | } // anonymous namespace |
| 24 |
no test coverage detected