make some statics actually static
This commit is contained in:
parent
ce507071b9
commit
55ffd09fe5
10
src/main.rs
10
src/main.rs
@ -74,10 +74,10 @@ fn worker(
|
|||||||
try_set_thread_priority();
|
try_set_thread_priority();
|
||||||
|
|
||||||
static INC: once_cell::sync::Lazy<BigUint> = Lazy::new(BigUint::one);
|
static INC: once_cell::sync::Lazy<BigUint> = Lazy::new(BigUint::one);
|
||||||
|
static ONE_THOUSAND: once_cell::sync::Lazy<BigUint> =
|
||||||
let one_thousand = &BigUint::from(SPLITTER * 10);
|
Lazy::new(|| BigUint::from(SPLITTER * 10));
|
||||||
let one_hundred = &BigUint::from(SPLITTER);
|
static ONE_HUNDRED: once_cell::sync::Lazy<BigUint> = Lazy::new(|| BigUint::from(SPLITTER));
|
||||||
let ten = &BigUint::from(10u8);
|
static TEN: once_cell::sync::Lazy<BigUint> = Lazy::new(|| BigUint::from(10u8));
|
||||||
|
|
||||||
let work_uint = BigUint::from(workloads);
|
let work_uint = BigUint::from(workloads);
|
||||||
let mut number = BigUint::from(i) * &work_uint;
|
let mut number = BigUint::from(i) * &work_uint;
|
||||||
@ -94,7 +94,7 @@ fn worker(
|
|||||||
progress.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
|
progress.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (&number * one_thousand) / &max / ten == &number / &max * one_hundred {
|
if (&number * &*ONE_THOUSAND) / &max / &*TEN == &number / &max * &*ONE_HUNDRED {
|
||||||
drop(global_primes);
|
drop(global_primes);
|
||||||
|
|
||||||
let mut new_primecache = arcclone.write().unwrap();
|
let mut new_primecache = arcclone.write().unwrap();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user