Skip to content

Commit fa1cfb9

Browse files
committed
Minor cleanup for more readable code
1 parent 661a613 commit fa1cfb9

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/random

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/random/RandomBuiltins.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,7 @@ PNone seedNone(PRandom random, @SuppressWarnings("unused") PNone none) {
134134
int[] seed = new int[PRandom.N];
135135
byte[] seedBytes = new byte[seed.length * Integer.BYTES];
136136
getContext().fillInitializationEntropyBytes(seedBytes);
137-
ByteBuffer seedBuffer = ByteBuffer.wrap(seedBytes).order(ByteOrder.BIG_ENDIAN);
138-
for (int i = 0; i < seed.length; i++) {
139-
seed[i] = seedBuffer.getInt();
140-
}
137+
ByteBuffer.wrap(seedBytes).order(ByteOrder.BIG_ENDIAN).asIntBuffer().get(seed);
141138
random.seed(seed);
142139
return PNone.NONE;
143140
}

0 commit comments

Comments
 (0)