Skip to content

Commit

Permalink
Fix cold
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Dec 12, 2021
1 parent b3153da commit afe0bab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/stats/cold.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,17 @@ const findClosestMean = function (array, { mean, minIndex, maxIndex, filter }) {
continue
}

if (filteredIndex > maxIndex) {
break
}

filteredIndex += 1
sum += value

if (filteredIndex <= minIndex) {
continue
}

if (filteredIndex > maxIndex) {
break
}

const incrementalMean = sum / filteredIndex
const meanDiff = Math.abs(mean - incrementalMean)

Expand Down

0 comments on commit afe0bab

Please sign in to comment.