diff options
| author | hachem <im@hachem.wtf> | 2026-09-04 07:04:49 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-04 07:04:49 +0200 |
| commit | dcb23f8b4b889061e96d43949d570581469cab84 (patch) | |
| tree | 2931979a4ba011104cc1931f3d7c30b02538f14b /src/ui/profiler.cpp | |
| parent | d3a1b908fd3b0c47da2c33c16d18ebeb00da3b97 (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); } |
