diff options
author | Damien George <damien.p.george@gmail.com> | 2017-12-19 15:45:56 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-12-19 15:45:56 +1100 |
commit | ae1be76d4063997b2703ba1ac9d009b31bc06eca (patch) | |
tree | d9ed086866eb5085ec8f83c74c190b03a8df70c8 /py/mpz.c | |
parent | 2bfa531798de1061e1417785acc42b892f96f532 (diff) |
py/mpz: Apply a small code-size optimisation.
Diffstat (limited to 'py/mpz.c')
-rw-r--r-- | py/mpz.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1395,8 +1395,9 @@ void mpz_pow3_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs, const mpz_t return; } + mpz_set_from_int(dest, 1); + if (rhs->len == 0) { - mpz_set_from_int(dest, 1); return; } @@ -1404,8 +1405,6 @@ void mpz_pow3_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs, const mpz_t mpz_t *n = mpz_clone(rhs); mpz_t quo; mpz_init_zero(&quo); - mpz_set_from_int(dest, 1); - while (n->len > 0) { if ((n->dig[0] & 1) != 0) { mpz_mul_inpl(dest, dest, x); |