ruby-changes:44462
From: nobu <ko1@a...>
Date: Tue, 1 Nov 2016 16:52:00 +0900 (JST)
Subject: [ruby-changes:44462] nobu:r56535 (trunk): bignum.c: use RB_INTEGER_TYPE_P
nobu 2016-11-01 16:51:55 +0900 (Tue, 01 Nov 2016) New Revision: 56535 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56535 Log: bignum.c: use RB_INTEGER_TYPE_P * bignum.c (rb_big_and, rb_big_or, rb_big_xor): use dedicated macro RB_INTEGER_TYPE_P instead of combination of FIXNUM_P and RB_BIGNUM_TYPE_P. Modified files: trunk/bignum.c Index: bignum.c =================================================================== --- bignum.c (revision 56534) +++ bignum.c (revision 56535) @@ -5385,7 +5385,7 @@ big_op(VALUE x, VALUE y, enum big_op_t o https://github.com/ruby/ruby/blob/trunk/bignum.c#L5385 VALUE rel; int n; - if (FIXNUM_P(y) || RB_BIGNUM_TYPE_P(y)) { + if (RB_INTEGER_TYPE_P(y)) { rel = rb_big_cmp(x, y); } else if (RB_FLOAT_TYPE_P(y)) { @@ -6285,7 +6285,7 @@ rb_big_and(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/bignum.c#L6285 BDIGIT tmph; long tmpn; - if (!FIXNUM_P(y) && !RB_BIGNUM_TYPE_P(y)) { + if (!RB_INTEGER_TYPE_P(y)) { return rb_num_coerce_bit(x, y, '&'); } @@ -6404,7 +6404,7 @@ rb_big_or(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/bignum.c#L6404 BDIGIT tmph; long tmpn; - if (!FIXNUM_P(y) && !RB_BIGNUM_TYPE_P(y)) { + if (!RB_INTEGER_TYPE_P(y)) { return rb_num_coerce_bit(x, y, '|'); } @@ -6498,7 +6498,7 @@ rb_big_xor(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/bignum.c#L6498 BDIGIT tmph; long tmpn; - if (!FIXNUM_P(y) && !RB_BIGNUM_TYPE_P(y)) { + if (!RB_INTEGER_TYPE_P(y)) { return rb_num_coerce_bit(x, y, '^'); } @@ -6665,7 +6665,7 @@ rb_big_hash(VALUE x) https://github.com/ruby/ruby/blob/trunk/bignum.c#L6665 static VALUE rb_int_coerce(VALUE x, VALUE y) { - if (FIXNUM_P(y) || RB_BIGNUM_TYPE_P(y)) { + if (RB_INTEGER_TYPE_P(y)) { return rb_assoc_new(y, x); } else { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/