summaryrefslogtreecommitdiff
path: root/gmp-impl.h
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2013-03-13 20:19:43 +0100
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2013-03-13 20:19:43 +0100
commit9df99612f1819a29279a2b4da96a6f4d600d2869 (patch)
tree32473be5aeaae1d8836463548b3b337e22e9e610 /gmp-impl.h
parent5ff8198dab87af6573b150a5b8d04bbb159dd1a1 (diff)
downloadgmp-9df99612f1819a29279a2b4da96a6f4d600d2869.tar.gz
gmp-impl.h (mpz_zero_p): Rewrite the for loop with a while.
Diffstat (limited to 'gmp-impl.h')
-rw-r--r--gmp-impl.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/gmp-impl.h b/gmp-impl.h
index 3f54abff1..0dd581296 100644
--- a/gmp-impl.h
+++ b/gmp-impl.h
@@ -4633,10 +4633,9 @@ mpn_sub_nc (mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n, mp_limb_t ci)
static inline int
mpn_zero_p (mp_srcptr ap, mp_size_t n)
{
- mp_size_t i;
- for (i = n - 1; i >= 0; i--)
+ while (--n >= 0)
{
- if (ap[i] != 0)
+ if (ap[n] != 0)
return 0;
}
return 1;