From 4f776f91af815b16c1b4cbf013185e1c6fe04065 Mon Sep 17 00:00:00 2001 From: Yuuki Takano Date: Wed, 25 Dec 2024 15:43:26 +0900 Subject: [PATCH] fix Signed-off-by: Yuuki Takano --- futures-util/src/async_await/random.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/futures-util/src/async_await/random.rs b/futures-util/src/async_await/random.rs index 772995f2a..df66d9641 100644 --- a/futures-util/src/async_await/random.rs +++ b/futures-util/src/async_await/random.rs @@ -70,10 +70,9 @@ fn random() -> u64 { x ^= x >> 12; x ^= x << 25; x ^= x >> 27; + x = x.wrapping_mul(0x2545_f491_4f6c_dd1d); } - let result = x.wrapping_mul(0x2545_f491_4f6c_dd1d) as u64; - RNG.store(result as usize, Ordering::Relaxed); - - result + RNG.store(x, Ordering::Relaxed); + x as u64 }