mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-05 21:56:42 +00:00
Replaced All Instances of Random With SplittableRandom
SplittableRandom is faster (negligable) than Random and is also able to recursively return new instances of itself for an even more complex pseudo random generator compared to the default Random supplied by Java.
This commit is contained in:
@ -10,7 +10,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
import java.util.SplittableRandom;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import javax.security.auth.login.LoginException;
|
||||
@ -292,7 +292,7 @@ public class Discord extends FreedomService
|
||||
public String generateCode(int size)
|
||||
{
|
||||
StringBuilder code = new StringBuilder();
|
||||
Random random = new Random();
|
||||
SplittableRandom random = new SplittableRandom();
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
code.append(random.nextInt(10));
|
||||
|
Reference in New Issue
Block a user