Skip to content

Commit 0df0efd

Browse files
committed
Removed pointer-to-pointer where a pointer was sufficient in isSmooth.
1 parent 455b7c7 commit 0df0efd

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/Smooth.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace Math {
77
namespace Fac {
8-
bool isSmooth(const mpz_t n, const mpz_t B, mpz_t *C) {
8+
bool isSmooth(const mpz_t n, const mpz_t B, mpz_t C) {
99
vector<mpz_t*> facs;
1010
pollardRhoFactor(n, facs);
1111

@@ -27,7 +27,7 @@ namespace Math {
2727
return true;
2828
}
2929

30-
if (C) mpz_set(*C, max);
30+
mpz_set(C, max);
3131

3232
mpz_clear(max);
3333
return false;

src/Smooth.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Math {
99
* Checks if n is B-smooth. Otherwise, if C is specified then that
1010
* will be the actual smoothness bound.
1111
*/
12-
bool isSmooth(const mpz_t n, const mpz_t B, mpz_t *C = NULL);
12+
bool isSmooth(const mpz_t n, const mpz_t B, mpz_t C = NULL);
1313

1414
bool isSmoothI(int n, int B, int *C = NULL);
1515
}

test/Smoothness.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ int main(int argc, char **argv) {
3737

3838
mpz_t C;
3939
mpz_init(C);
40-
if (isSmooth(num, B, &C)) {
40+
if (isSmooth(num, B, C)) {
4141
dump(num, "", false);
4242
dump(B, " is", false);
4343
cout << "-smooth." << endl;

0 commit comments

Comments
 (0)