Skip to content

Commit

Permalink
Folder Raises are off by one (#992)
Browse files Browse the repository at this point in the history
Fixes #953
  • Loading branch information
zkrising committed Feb 6, 2024
1 parent 390652f commit 868ccb6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/src/utils/folder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,11 @@ export async function GetEnumDistForFolderAsOf(
thisEnumDist[val] = 1;
}

// for the cumulative dist, count up until this metric.
for (const val of conf.values.slice(0, score[metric])) {
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands, @typescript-eslint/no-non-null-assertion
const end = score[metric]! + 1;

// for the cumulative dist, count up until this metric; inclusive
for (const val of conf.values.slice(0, end)) {
if (thisCumulativeEnumDist[val] !== undefined) {
thisCumulativeEnumDist[val]++;
} else {
Expand Down

0 comments on commit 868ccb6

Please sign in to comment.