Skip to content

Commit

Permalink
remove while loop
Browse files Browse the repository at this point in the history
rip rollover
  • Loading branch information
ghzdude committed Sep 7, 2024
1 parent d86ae1f commit 70c6700
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ public interface ChancedOutputLogic {
for (T entry : chancedEntries) {
int chance = getChance(entry, boostFunction, baseTier, machineTier);
if (passesChance(chance, entry, cache)) {
do {
builder.add(entry);
} while (passesChance(chance, entry, cache));
builder.add(entry);
}
}

Expand Down Expand Up @@ -174,7 +172,7 @@ static <I, T extends ChancedOutput<I>> boolean passesChance(int chance, T entry,

int fullChance = getCachedChance(entry, cache) + chance;
if (fullChance >= entry.getMaxChance()) {
fullChance -= entry.getMaxChance();
fullChance %= entry.getMaxChance();
updateCachedChance(entry.getIngredient(), cache, fullChance);
return true;
}
Expand Down

0 comments on commit 70c6700

Please sign in to comment.