ruby-changes:44466
From: nobu <ko1@a...>
Date: Tue, 1 Nov 2016 22:10:19 +0900 (JST)
Subject: [ruby-changes:44466] nobu:r56539 (trunk): numeric.c: use rb_num_coerce_bit
nobu 2016-11-01 22:10:14 +0900 (Tue, 01 Nov 2016) New Revision: 56539 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56539 Log: numeric.c: use rb_num_coerce_bit * numeric.c (int_and, int_or, int_xor): use rb_num_coerce_bit to reduce repeated code. Modified files: trunk/numeric.c Index: numeric.c =================================================================== --- numeric.c (revision 56538) +++ numeric.c (revision 56539) @@ -4168,8 +4168,7 @@ fix_and(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/numeric.c#L4168 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) https://github.com/ruby/ruby/blob/trunk/numeric.c#L4203 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) https://github.com/ruby/ruby/blob/trunk/numeric.c#L4238 return rb_big_xor(y, x); } - bit_coerce(&x, &y); - return num_funcall1(x, '^', y); + return rb_num_coerce_bit(x, y, '^'); } static VALUE -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/