[offers][fix] Fix out of bounds bug when calculating analysis percentile

This commit is contained in:
Bryann Yeap Kok Keong
2022-11-07 03:34:53 +08:00
parent a421a0d98a
commit 058765bf47

View File

@@ -200,7 +200,7 @@ const calculatePercentile = (
if (salary !== lastOfferSalary) {
if (salary === offerToCalculateSalary && offerToCalculateIndex === -1) {
offerToCalculateIndex = i;
offerToCalculateIndex = numberOfNoDuplicateOffers;
}
numberOfNoDuplicateOffers++;
lastOfferSalary = salary;