-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
There appears to be bug in the 'searches' stat as a result of 56aba08.
It's here:
Line 238 in 09a2709
| const int64_t avg_tens = (stat->total == 0 ? 0 : (stat->total*10 / stat->total)); |
const int64_t avg_tens = (stat->total == 0 ? 0 : (stat->total*10 / stat->total));
If total is zero, then avg_tens is 0. If total is non-zero, avg_tens is 10; we're multiplying total by 10 and dividing it by itself.
Prior to the refactoring in that commit, the searches field was a tuple, containing a count and a total, and the math used to be:
const int64_t avg_tens = (stat->count == 0 ? 0 : (stat->total*10 / stat->count));
@daanx Not sure what the correct course of action is here -- should this be divided by some other field now?
Metadata
Metadata
Assignees
Labels
No labels