mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-02 05:57:46 +00:00
factor::factor: Remove extraneous call to the primality test
Another 6.97% runtime improvement
This commit is contained in:
parent
e1a6dbe619
commit
74054feb94
1 changed files with 0 additions and 5 deletions
|
@ -93,11 +93,6 @@ fn factor(mut n: u64) -> Factors {
|
||||||
return factors;
|
return factors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if numeric::is_prime(n) {
|
|
||||||
factors.push(n);
|
|
||||||
return factors;
|
|
||||||
}
|
|
||||||
|
|
||||||
let (f, n) = table::factor(n);
|
let (f, n) = table::factor(n);
|
||||||
factors *= f;
|
factors *= f;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue