mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-05-17 22:33:57 +08:00
perf: this is just Math.min
This commit is contained in:
@@ -104,7 +104,7 @@ public class GachaSystem extends BaseGameSystem {
|
||||
}
|
||||
total += weight;
|
||||
}
|
||||
int roll = ThreadLocalRandom.current().nextInt((total < cutoff) ? total : cutoff);
|
||||
int roll = ThreadLocalRandom.current().nextInt(Math.min(total, cutoff));
|
||||
int subTotal = 0;
|
||||
for (int i = 0; i < weights.length; i++) {
|
||||
subTotal += weights[i];
|
||||
|
||||
Reference in New Issue
Block a user