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

pull/522/head
Bryann Yeap Kok Keong 2 years ago
parent a421a0d98a
commit 058765bf47

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

Loading…
Cancel
Save