fixup! refactor: tr_completion (#2220)

fix: incorrect calculation in amountDone
This commit is contained in:
Charles Kerr 2021-11-28 22:11:30 -06:00
parent 35fe175f2a
commit 9516e8a923
1 changed files with 1 additions and 1 deletions

View File

@ -92,7 +92,7 @@ void tr_completion::amountDone(float* tab, size_t n_tabs) const
auto const blocks_per_tab = std::size(blocks_) / n_tabs;
for (size_t i = 0; i < n_tabs; ++i)
{
auto const begin = i * n_tabs;
auto const begin = i * blocks_per_tab;
auto const end = std::min(begin + blocks_per_tab, std::size(blocks_));
auto const numerator = blocks_.count(begin, end);
tab[i] = (double)numerator / (end - begin);