aboutsummaryrefslogtreecommitdiffstats
path: root/bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/bignum.c b/bignum.c
index 750fd84b43..7e36ccbb15 100644
--- a/bignum.c
+++ b/bignum.c
@@ -4651,13 +4651,10 @@ bigand_int(VALUE x, long y)
i = 1;
zds[0] = xds[0] & y;
#else
- {
- long num = y;
-
- for (i=0; i<bdigit_roomof(SIZEOF_LONG); i++) {
- zds[i] = xds[i] & BIGLO(num);
- num = BIGDN(num);
- }
+ for (i=0; i < xn; i++) {
+ if (y == 0 || y == -1) break;
+ zds[i] = xds[i] & BIGLO(y);
+ y = BIGDN(y);
}
#endif
while (i < xn) {