fix coverity

This commit is contained in:
nroskill
2024-03-14 02:16:16 +00:00
committed by ob-robot
parent 3d8640c594
commit cff976601e
4 changed files with 7 additions and 6 deletions

View File

@ -282,7 +282,7 @@ void ObTaskController::calc_log_rate()
{
const double total = std::accumulate(
rate_pctgs_, rate_pctgs_ + MAX_TASK_ID, .0);
for (int i = 0; total != 0 && i < MAX_TASK_ID; i++) {
for (int i = 0; total > 0 && i < MAX_TASK_ID; i++) {
limiters_[i]->set_rate(
static_cast<int64_t>(
rate_pctgs_[i]/total * static_cast<double>(log_rate_limit_)));