@@ -337,7 +337,7 @@ impl<'a, Borrowed> SampleBorrow<Borrowed> for &'a Borrowed where Borrowed: Sampl
337
337
pub struct UniformInt < X > {
338
338
low : X ,
339
339
range : X ,
340
- ints_to_reject : X ,
340
+ z : X , // either ints_to_reject or zone depending on implementation
341
341
}
342
342
343
343
macro_rules! uniform_int_impl {
@@ -391,15 +391,15 @@ macro_rules! uniform_int_impl {
391
391
low: low,
392
392
// These are really $unsigned values, but store as $ty:
393
393
range: range as $ty,
394
- ints_to_reject : ints_to_reject as $unsigned as $ty
394
+ z : ints_to_reject as $unsigned as $ty
395
395
}
396
396
}
397
397
398
398
fn sample<R : Rng + ?Sized >( & self , rng: & mut R ) -> Self :: X {
399
399
let range = self . range as $unsigned as $u_large;
400
400
if range > 0 {
401
401
let unsigned_max = :: core:: $u_large:: MAX ;
402
- let zone = unsigned_max - ( self . ints_to_reject as $unsigned as $u_large) ;
402
+ let zone = unsigned_max - ( self . z as $unsigned as $u_large) ;
403
403
loop {
404
404
let v: $u_large = rng. gen ( ) ;
405
405
let ( hi, lo) = v. wmul( range) ;
@@ -524,13 +524,13 @@ macro_rules! uniform_simd_int_impl {
524
524
low: low,
525
525
// These are really $unsigned values, but store as $ty:
526
526
range: range. cast( ) ,
527
- zone : zone. cast( ) ,
527
+ z : zone. cast( ) ,
528
528
}
529
529
}
530
530
531
531
fn sample<R : Rng + ?Sized >( & self , rng: & mut R ) -> Self :: X {
532
532
let range: $unsigned = self . range. cast( ) ;
533
- let zone: $unsigned = self . zone . cast( ) ;
533
+ let zone: $unsigned = self . z . cast( ) ;
534
534
535
535
// This might seem very slow, generating a whole new
536
536
// SIMD vector for every sample rejection. For most uses
0 commit comments