Skip to content

Commit ae1be76

Browse files
committed
py/mpz: Apply a small code-size optimisation.
1 parent 2bfa531 commit ae1be76

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

py/mpz.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,17 +1395,16 @@ void mpz_pow3_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs, const mpz_t
13951395
return;
13961396
}
13971397

1398+
mpz_set_from_int(dest, 1);
1399+
13981400
if (rhs->len == 0) {
1399-
mpz_set_from_int(dest, 1);
14001401
return;
14011402
}
14021403

14031404
mpz_t *x = mpz_clone(lhs);
14041405
mpz_t *n = mpz_clone(rhs);
14051406
mpz_t quo; mpz_init_zero(&quo);
14061407

1407-
mpz_set_from_int(dest, 1);
1408-
14091408
while (n->len > 0) {
14101409
if ((n->dig[0] & 1) != 0) {
14111410
mpz_mul_inpl(dest, dest, x);

0 commit comments

Comments
 (0)