diff options
| author | hachem <im@hachem.wtf> | 2025-12-21 07:04:49 +0100 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2025-12-21 07:04:49 +0100 |
| commit | 75c96946c9ad945fadede7d16130966f601ccaa7 (patch) | |
| tree | 33573a9996e36d009a64d337b63b6a73b30a46ba /src/ui/profiler.cpp | |
| parent | d660dc5748656e7ddc7b3343c96d9a7bdaadd502 (diff) | |
refactor: slight cleanup
Diffstat (limited to 'src/ui/profiler.cpp')
| -rw-r--r-- | src/ui/profiler.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ui/profiler.cpp b/src/ui/profiler.cpp index df22a20..b917704 100644 --- a/src/ui/profiler.cpp +++ b/src/ui/profiler.cpp @@ -1,5 +1,7 @@ #include "ui/profiler.h" +#include <numeric> + namespace Hsdbg { auto TimeSeries::push(float value) -> void @@ -32,9 +34,7 @@ namespace Hsdbg if (m_count == 0) return 0.0f; - float sum = 0.0f; - for (int i = 0; i < m_count; ++i) - sum += m_values[i]; + const float sum = std::accumulate(m_values.begin(), m_values.begin() + m_count, 0.0f); return sum / static_cast<float>(m_count); } |
