Fix a trivial bug with fixed point average calculation introduced by careless copying a few commits below

sql-rework
Tomasz Golinski 2020-07-06 18:39:37 +02:00
rodzic 3d33de5a23
commit 9148516ac6
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -251,5 +251,5 @@ float average(const Caches& cc, float Cache::*ptr) {
}
float average(const Caches& cc, int Cache::*ptr) {
return std::accumulate(cc.begin(), cc.end(), 0, [&](const float& a, const Cache& b) { return std::move(a) + b.*ptr; }) / cc.size();
return 1.0 * std::accumulate(cc.begin(), cc.end(), 0, [&](const float& a, const Cache& b) { return std::move(a) + b.*ptr; }) / cc.size();
}