rng inlining

This commit is contained in:
Alula 2020-09-05 06:26:01 +02:00
parent ab7902dac1
commit 61b45b45af
No known key found for this signature in database
GPG Key ID: 3E00485503A1D8BA
1 changed files with 3 additions and 0 deletions

View File

@ -2,6 +2,7 @@ use std::cell::Cell;
pub struct RNG(Cell<(u64, u64, u64, u64)>);
#[inline]
fn rol64(x: u64, shift: u64) -> u64
{
if shift == 0 || shift == 64 {
@ -37,10 +38,12 @@ impl RNG {
result as i32
}
#[inline]
pub fn next(&self) -> i32 {
self.next_u64() as i32
}
#[inline]
pub fn next_u32(&self) -> u32 {
self.next_u64() as u32
}