mruby-bigint (uzero_p): add fast path

This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-07-25 15:41:24 +09:00
parent 4ee7c8e021
commit 93653dfd4c
+1
View File
@@ -248,6 +248,7 @@ ucmp(mpz_t *y, mpz_t *x)
static int
uzero_p(mpz_t *x)
{
if (x->sz == 0) return 1;
for (size_t i=0; i < x->sz; i++)
if (x->p[i] != 0)
return 0;