1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-01 05:27:45 +00:00

factor::factor: Remove extraneous call to the primality test

Another 6.97% runtime improvement
This commit is contained in:
nicoo 2020-05-24 15:41:23 +02:00
parent e1a6dbe619
commit 74054feb94

View file

@ -93,11 +93,6 @@ fn factor(mut n: u64) -> Factors {
return factors;
}
if numeric::is_prime(n) {
factors.push(n);
return factors;
}
let (f, n) = table::factor(n);
factors *= f;