ruby-changes:29448
From: akr <ko1@a...>
Date: Thu, 20 Jun 2013 22:52:30 +0900 (JST)
Subject: [ruby-changes:29448] akr:r41500 (trunk): * bignum.c (bignorm): Don't call bigtrunc if the result is a fixnum.
akr 2013-06-20 22:52:19 +0900 (Thu, 20 Jun 2013) New Revision: 41500 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41500 Log: * bignum.c (bignorm): Don't call bigtrunc if the result is a fixnum. Modified files: trunk/ChangeLog trunk/bignum.c Index: ChangeLog =================================================================== --- ChangeLog (revision 41499) +++ ChangeLog (revision 41500) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Jun 20 22:49:27 2013 Tanaka Akira <akr@f...> + + * bignum.c (bignorm): Don't call bigtrunc if the result is a fixnum. + Thu Jun 20 22:29:42 2013 Tanaka Akira <akr@f...> * bignum.c (rb_uint2big): Refactored. Index: bignum.c =================================================================== --- bignum.c (revision 41499) +++ bignum.c (revision 41500) @@ -322,7 +322,9 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/bignum.c#L322 bignorm(VALUE x) { if (RB_TYPE_P(x, T_BIGNUM)) { - x = bigfixize(bigtrunc(x)); + x = bigfixize(x); + if (!FIXNUM_P(x)) + bigtrunc(x); } return x; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/