aboutsummaryrefslogtreecommitdiffstats
path: root/internal.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-15 05:15:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-15 05:15:33 +0000
commit49079911ba45098a7d3f910bb4bf0e0bcc9dad49 (patch)
treea77d74f189f5416755708c3449df7f0104665d4c /internal.h
parent174be800271b112c01e28702751aba715778d798 (diff)
downloadruby-49079911ba45098a7d3f910bb4bf0e0bcc9dad49.tar.gz
bignum.c: micro optimization
* bignum.c (rb_big_uminus, bigsub_int): use BIGNUM_NEGATE. * internal.h (BIGNUM_NEGATE): simplify negation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index 637ef1619b..949c6f8a42 100644
--- a/internal.h
+++ b/internal.h
@@ -364,6 +364,7 @@ struct RBignum {
: (RBASIC(b)->flags &= ~BIGNUM_SIGN_BIT))
#define BIGNUM_POSITIVE_P(b) BIGNUM_SIGN(b)
#define BIGNUM_NEGATIVE_P(b) (!BIGNUM_SIGN(b))
+#define BIGNUM_NEGATE(b) (RBASIC(b)->flags ^= BIGNUM_SIGN_BIT)
#define BIGNUM_EMBED_FLAG FL_USER2
#define BIGNUM_EMBED_LEN_MASK (FL_USER5|FL_USER4|FL_USER3)