Skip to content

Commit bd97990

Browse files
Merge pull request #110 from ParallelMC/random-tools
Random tools
2 parents c9a7015 + ce936af commit bd97990

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

api/src/main/java/parallelmc/parallelutils/util/RandomTools.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
*/
88
public class RandomTools {
99

10+
private static final Random r = new Random();
11+
1012
/**
1113
* Calculates a random integer between two integer values
1214
* @param low The first integer
1315
* @param high The second integer
1416
* @return The random integer between low and high, inclusive
1517
*/
1618
public static int betweenTwoNumbers(int low, int high) {
17-
Random r = new Random();
1819
return r.nextInt(high - low + 1) + low;
1920
}
2021
}

0 commit comments

Comments
 (0)