diff --git a/lib/sponsors.ts b/lib/sponsors.ts index a4000fd7c..7c14a5fcd 100644 --- a/lib/sponsors.ts +++ b/lib/sponsors.ts @@ -107,13 +107,9 @@ export function makeIconSets( const toPick = icons.map(icon => { return { icon: icon, - // Number of times we'd expect to see this, divided by number of times we saw it. Special cased for - // icons that have to show every time. Which kinda tells me the algorithm is broken, but this was - // enough to get things working for now. - error: - icon.topIconShowEvery === 1 - ? Infinity - : result.length / icon.topIconShowEvery / (sponsorAppearanceCount.get(icon) || 0.00001), + // Number of times we'd expect to see this, divided by number of times we saw it, assuming that we pick + // this one next. + error: (result.length + 1) / icon.topIconShowEvery / ((sponsorAppearanceCount.get(icon) || 0) + 1), }; }); toPick.sort((lhs, rhs) => rhs.error - lhs.error);