summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authorS-H-GAMELINKS <gamelinks007@gmail.com>2021-08-31 20:30:35 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-05 23:01:27 +0900
commitbdd6d8746f0a07b2c0cc3a6b387bf594569c0bb7 (patch)
treef11d32da65e227763d598d765765a76ddace1a0a /bignum.c
parent8f752c95d20134bcc0b5394f1cea723a40f1ac8c (diff)
Replace RBOOL macro
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4791
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bignum.c b/bignum.c
index 939b33ca45..9e1ded5909 100644
--- a/bignum.c
+++ b/bignum.c
@@ -5471,10 +5471,10 @@ big_op(VALUE x, VALUE y, enum big_op_t op)
n = FIX2INT(rel);
switch (op) {
- case big_op_gt: return n > 0 ? Qtrue : Qfalse;
- case big_op_ge: return n >= 0 ? Qtrue : Qfalse;
- case big_op_lt: return n < 0 ? Qtrue : Qfalse;
- case big_op_le: return n <= 0 ? Qtrue : Qfalse;
+ case big_op_gt: return RBOOL(n > 0);
+ case big_op_ge: return RBOOL(n >= 0);
+ case big_op_lt: return RBOOL(n < 0);
+ case big_op_le: return RBOOL(n <= 0);
}
return Qundef;
}
@@ -5518,7 +5518,7 @@ VALUE
rb_big_eq(VALUE x, VALUE y)
{
if (FIXNUM_P(y)) {
- return bignorm(x) == y ? Qtrue : Qfalse;
+ return RBOOL(bignorm(x) == y);
}
else if (RB_BIGNUM_TYPE_P(y)) {
}