Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Dec 12, 2021
1 parent 49e9ea8 commit b3153da
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/stats/cold.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,12 @@ export const getColdStats = function (
length = array.filter(filter).length,
},
) {
const minIndex = getIndexFromLength(COLD_MIN_PERCENTAGE, length)
const maxIndex = getIndexFromLength(COLD_MAX_PERCENTAGE, length)
const cold = getCold(array, { mean, filter, minIndex, maxIndex })
const cold = getCold(array, { mean, filter, length })
const coldLoopsTarget = getColdLoopsTarget(array, {
precisionTarget,
mean,
filter,
length,
minIndex,
})
return { cold, coldLoopsTarget }
}
Expand All @@ -44,7 +41,9 @@ const defaultFilter = function () {
return true
}

const getCold = function (array, { mean, filter, minIndex, maxIndex }) {
const getCold = function (array, { mean, filter, length }) {
const minIndex = getIndexFromLength(COLD_MIN_PERCENTAGE, length)
const maxIndex = getIndexFromLength(COLD_MAX_PERCENTAGE, length)
const closestMean = findClosestMean(array, {
mean,
minIndex,
Expand All @@ -59,8 +58,9 @@ const getCold = function (array, { mean, filter, minIndex, maxIndex }) {
// Used to estimate the duration of the benchmark in previews.
const getColdLoopsTarget = function (
array,
{ precisionTarget, mean, filter, length, minIndex },
{ precisionTarget, mean, filter, length },
) {
const minIndex = getIndexFromLength(COLD_MIN_PERCENTAGE, length)
const incrementalMeanMin = mean * (1 - precisionTarget)
const incrementalMeanMax = mean * (1 + precisionTarget)
const hotIndex = findHotIndex(array, {
Expand Down

0 comments on commit b3153da

Please sign in to comment.