aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/factor.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-07-16 09:43:27 +0000
committerlloyd <[email protected]>2006-07-16 09:43:27 +0000
commitfc8fa48714eaf79bf9b861981066b7a6c74a702f (patch)
tree11385d2220aea99feefc301a0056b7e710a1ca18 /doc/examples/factor.cpp
parent03ff2bbdf9cff8bddb84ce644641a33f2f2cc4a0 (diff)
Remove some completely redundant code in factorize()
Diffstat (limited to 'doc/examples/factor.cpp')
-rw-r--r--doc/examples/factor.cpp7
1 files changed, 1 insertions, 6 deletions
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<BigInt> remove_small_factors(BigInt& n)
{
std::vector<BigInt> factors;
@@ -86,12 +87,6 @@ std::vector<BigInt> factorize(const BigInt& n_in)
BigInt n = n_in;
std::vector<BigInt> factors = remove_small_factors(n);
- if(is_prime(n))
- {
- factors.push_back(n);
- return factors;
- }
-
while(n != 1)
{
if(is_prime(n))