From fc8fa48714eaf79bf9b861981066b7a6c74a702f Mon Sep 17 00:00:00 2001 From: lloyd Date: Sun, 16 Jul 2006 09:43:27 +0000 Subject: Remove some completely redundant code in factorize() --- doc/examples/factor.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'doc/examples/factor.cpp') diff --git a/doc/examples/factor.cpp b/doc/examples/factor.cpp index b7b116159..b8e02e19f 100644 --- a/doc/examples/factor.cpp +++ b/doc/examples/factor.cpp @@ -45,6 +45,7 @@ BigInt rho(const BigInt& n) return 0; } +// Remove (and return) any small (< 2^16) factors std::vector remove_small_factors(BigInt& n) { std::vector factors; @@ -86,12 +87,6 @@ std::vector factorize(const BigInt& n_in) BigInt n = n_in; std::vector factors = remove_small_factors(n); - if(is_prime(n)) - { - factors.push_back(n); - return factors; - } - while(n != 1) { if(is_prime(n)) -- cgit v1.2.3