9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00

fix FasterRandomSource#next generate same random number (#374)

This commit is contained in:
hayanesuru
2025-06-15 10:40:02 +09:00
committed by GitHub
parent 07f5022110
commit 510ddf3bbc

View File

@@ -56,11 +56,7 @@ public class FasterRandomSource implements BitRandomSource {
@Override @Override
public final int next(int bits) { public final int next(int bits) {
if (useDirectImpl) { return (int) ((seed = seed * MULTIPLIER + INCREMENT & SEED_MASK) >>> (INT_BITS - bits));
return (int) ((seed = seed * MULTIPLIER + INCREMENT & SEED_MASK) >>> (INT_BITS - bits));
}
return (int) ((seed * MULTIPLIER + INCREMENT & SEED_MASK) >>> (INT_BITS - bits));
} }
public static class FasterRandomSourcePositionalRandomFactory implements PositionalRandomFactory { public static class FasterRandomSourcePositionalRandomFactory implements PositionalRandomFactory {