Fix coverity complaint about commit 40d964ec99.

The coverity complained that dividing integer expressions and then
converting the integer quotient to type "double" would lose fractional
part.  Typecasting one of the arguments of expression with double should
fix the report.

Author: Mahendra Singh Thalor
Reviewed-by: Amit Kapila
Discussion: https://postgr.es/m/20200329224818.6phnhv7o2q2rfovf@alap3.anarazel.de
This commit is contained in:
Amit Kapila 2020-04-01 09:28:13 +05:30
parent 08481eedd1
commit 2401d93718
1 changed files with 1 additions and 1 deletions

View File

@ -2077,7 +2077,7 @@ compute_parallel_delay(void)
VacuumCostBalanceLocal += VacuumCostBalance;
if ((shared_balance >= VacuumCostLimit) &&
(VacuumCostBalanceLocal > 0.5 * (VacuumCostLimit / nworkers)))
(VacuumCostBalanceLocal > 0.5 * ((double) VacuumCostLimit / nworkers)))
{
/* Compute sleep time based on the local cost balance */
msec = VacuumCostDelay * VacuumCostBalanceLocal / VacuumCostLimit;