From 868ccb6b55f81a2431b461fb997719b97d3224b7 Mon Sep 17 00:00:00 2001 From: zkldi Date: Tue, 6 Feb 2024 22:11:41 +0000 Subject: [PATCH] Folder Raises are off by one (#992) Fixes #953 --- server/src/utils/folder.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/src/utils/folder.ts b/server/src/utils/folder.ts index ded27f773..a4c2a24de 100644 --- a/server/src/utils/folder.ts +++ b/server/src/utils/folder.ts @@ -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 {