AQICalculator is off by 1 (#1331)

Co-authored-by: Igor Katkov <ikatkov@atlassian.com>
This commit is contained in:
ikatkov 2020-10-22 19:33:12 -07:00 committed by GitHub
parent e50644edee
commit 7b157aeff1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ class AQICalculator : public AbstractAQICalculator {
} }
int get_grid_index_(uint16_t value, int array[AMOUNT_OF_LEVELS][2]) { int get_grid_index_(uint16_t value, int array[AMOUNT_OF_LEVELS][2]) {
for (int i = 0; i < AMOUNT_OF_LEVELS - 1; i++) { for (int i = 0; i < AMOUNT_OF_LEVELS; i++) {
if (value >= array[i][0] && value <= array[i][1]) { if (value >= array[i][0] && value <= array[i][1]) {
return i; return i;
} }