chiark
/
gitweb
/
~mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f49478
)
math/mp-nthrt.c: Delete redundant check for termination.
author
Mark Wooding
<mdw@distorted.org.uk>
Wed, 14 Oct 2020 02:02:21 +0000
(
03:02
+0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Wed, 14 Oct 2020 02:02:21 +0000
(
03:02
+0100)
This case is already handled above.
math/mp-nthrt.c
patch
|
blob
|
blame
|
history
diff --git
a/math/mp-nthrt.c
b/math/mp-nthrt.c
index a46590afc521e3bc18c83e064c068f0241566975..80185e0d7ca76b4f77f425ba517f83fe302d878c 100644
(file)
--- a/
math/mp-nthrt.c
+++ b/
math/mp-nthrt.c
@@
-180,10
+180,9
@@
int mp_perfect_power_p(mp **x, mp **n, mp *a)
t = mp_nthrt(t, a, p, &exactp);
if (MP_EQ(t, MP_ONE))
break;
- else if (!exactp) {
- if (MP_EQ(t, MP_ONE)) break;
+ else if (!exactp)
p = primeiter_next(&pi, p);
-
}
else {
+ else {
r = mp_mul(r, r, p);
MP_DROP(a); a = t; t = MP_NEW;
rc = 1;