make some statics actually static

This commit is contained in:
code002lover 2024-07-17 01:00:15 +02:00
parent ce507071b9
commit 55ffd09fe5

View File

@ -74,10 +74,10 @@ fn worker(
try_set_thread_priority();
static INC: once_cell::sync::Lazy<BigUint> = Lazy::new(BigUint::one);
let one_thousand = &BigUint::from(SPLITTER * 10);
let one_hundred = &BigUint::from(SPLITTER);
let ten = &BigUint::from(10u8);
static ONE_THOUSAND: once_cell::sync::Lazy<BigUint> =
Lazy::new(|| BigUint::from(SPLITTER * 10));
static ONE_HUNDRED: once_cell::sync::Lazy<BigUint> = Lazy::new(|| BigUint::from(SPLITTER));
static TEN: once_cell::sync::Lazy<BigUint> = Lazy::new(|| BigUint::from(10u8));
let work_uint = BigUint::from(workloads);
let mut number = BigUint::from(i) * &work_uint;
@ -94,7 +94,7 @@ fn worker(
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);
let mut new_primecache = arcclone.write().unwrap();