Skip to content

Commit

Permalink
Remove unnecessary seed modifcation
Browse files Browse the repository at this point in the history
Because the first step of wyrand is an addition with a constant, a non-zero seed is not required
  • Loading branch information
ironhaven authored and notgull committed Apr 27, 2024
1 parent a8f98b4 commit 63175fa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/global_rng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ fn random_seed() -> Option<u64> {
let mut hasher = DefaultHasher::new();
Instant::now().hash(&mut hasher);
thread::current().id().hash(&mut hasher);
let hash = hasher.finish();
Some((hash << 1) | 1)
Some(hasher.finish())
}

#[cfg(all(
Expand Down

0 comments on commit 63175fa

Please sign in to comment.