From 74054feb94173fdbc40a9e54e9b37fa579c61e38 Mon Sep 17 00:00:00 2001 From: nicoo Date: Sun, 24 May 2020 15:41:23 +0200 Subject: [PATCH] factor::factor: Remove extraneous call to the primality test Another 6.97% runtime improvement --- src/uu/factor/src/factor.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/uu/factor/src/factor.rs b/src/uu/factor/src/factor.rs index 1e5b3bb8f..afaf4f8cd 100644 --- a/src/uu/factor/src/factor.rs +++ b/src/uu/factor/src/factor.rs @@ -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;