aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-01 13:10:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-01 13:10:14 +0000
commit3dc8b9ee10f588be84a6a2298549f2f14c651c92 (patch)
treef61af440a27902fb8d3a52ca52958f2b0c44e98e /numeric.c
parentdf5c57f2ceb8df6c1956677cd9f8272b16771ad7 (diff)
downloadruby-3dc8b9ee10f588be84a6a2298549f2f14c651c92.tar.gz
numeric.c: use rb_num_coerce_bit
* numeric.c (int_and, int_or, int_xor): use rb_num_coerce_bit to reduce repeated code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/numeric.c b/numeric.c
index 9a9b8d0b44..75e0ebf468 100644
--- a/numeric.c
+++ b/numeric.c
@@ -4168,8 +4168,7 @@ fix_and(VALUE x, VALUE y)
return rb_big_and(y, x);
}
- bit_coerce(&x, &y);
- return num_funcall1(x, '&', y);
+ return rb_num_coerce_bit(x, y, '&');
}
static VALUE
@@ -4204,8 +4203,7 @@ fix_or(VALUE x, VALUE y)
return rb_big_or(y, x);
}
- bit_coerce(&x, &y);
- return num_funcall1(x, '|', y);
+ return rb_num_coerce_bit(x, y, '|');
}
static VALUE
@@ -4240,8 +4238,7 @@ fix_xor(VALUE x, VALUE y)
return rb_big_xor(y, x);
}
- bit_coerce(&x, &y);
- return num_funcall1(x, '^', y);
+ return rb_num_coerce_bit(x, y, '^');
}
static VALUE