From 3dc8b9ee10f588be84a6a2298549f2f14c651c92 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 1 Nov 2016 13:10:14 +0000 Subject: 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 --- numeric.c | 9 +++------ 1 file 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 -- cgit v1.2.3