[ruby-cvs:62692] naruse:r55528 (trunk): * bignum.c (rb_big2ulong): the old logic seems to try to avoid

naruse at ruby-lang.org naruse at ruby-lang.org
Wed Jun 29 03:42:12 JST 2016


naruse	2016-06-29 03:42:12 +0900 (Wed, 29 Jun 2016)

  New Revision: 55528

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55528

  Log:
    * bignum.c (rb_big2ulong): the old logic seems to try to avoid
      calculating `-(long)(num-1)-1` if `num` is not LONG_MIN. (Note that
      `-LONG_MIN` may be larger than LONG_MAX) But C compilers can
      optimize it into single NEG instruction.
      Therefore those two conditions can be single if-body.
    
    * bignum.c (rb_big2long): ditto.
    
    * bignum.c (rb_big2ull): ditto.
    
    * bignum.c (rb_big2ll): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/bignum.c


More information about the ruby-cvs mailing list