Skip to content

Commit bb40ef2

Browse files
committed
Shrinking the buffer up to size of the long type
1 parent b6f837c commit bb40ef2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

core/src/main/scala/org/apache/spark/util/random/XORShiftRandom.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private[spark] object XORShiftRandom {
6161

6262
/** Hash seeds to have 0/1 bits throughout. */
6363
private[random] def hashSeed(seed: Long): Long = {
64-
val bytes = ByteBuffer.allocate(java.lang.Long.SIZE).putLong(seed).array()
64+
val bytes = ByteBuffer.allocate(java.lang.Long.BYTES).putLong(seed).array()
6565
val lowBits = MurmurHash3.bytesHash(bytes)
6666
val highBits = MurmurHash3.bytesHash(bytes, lowBits)
6767
(highBits.toLong << 32) | (lowBits.toLong & 0xFFFFFFFFL)

0 commit comments

Comments
 (0)