mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-04 23:53:20 +08:00
perf: this is just Math.min
This commit is contained in:
parent
dd9f59fbfc
commit
4b03304cdc
@ -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];
|
||||
|
@ -118,7 +118,7 @@ public class BlossomManager {
|
||||
|
||||
public void notifyIcon() {
|
||||
final int wl = getWorldLevel();
|
||||
final int worldLevel = (wl < 0) ? 0 : ((wl > 8) ? 8 : wl);
|
||||
final int worldLevel = (wl < 0) ? 0 : (Math.min(wl, 8));
|
||||
final var worldLevelData = GameData.getWorldLevelDataMap().get(worldLevel);
|
||||
final int monsterLevel = (worldLevelData != null) ? worldLevelData.getMonsterLevel() : 1;
|
||||
List<BlossomBriefInfoOuterClass.BlossomBriefInfo> blossoms = new ArrayList<>();
|
||||
|
Loading…
Reference in New Issue
Block a user