summaryrefslogtreecommitdiff
path: root/compar.c
diff options
context:
space:
mode:
authorS.H <gamelinks007@gmail.com>2021-08-02 12:06:44 +0900
committerGitHub <noreply@github.com>2021-08-02 12:06:44 +0900
commit378e8cdad69e6ba995a024da2957719789f0679e (patch)
tree99ffe0f8055bc10cba3225fb5e7a906f5c3f4543 /compar.c
parent3688b476710def7290e32656b200fefc538366d0 (diff)
Using RBOOL macro
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4695 Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'compar.c')
-rw-r--r--compar.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/compar.c b/compar.c
index 0de318525c..7974017e2b 100644
--- a/compar.c
+++ b/compar.c
@@ -105,8 +105,7 @@ cmpint(VALUE x, VALUE y)
static VALUE
cmp_gt(VALUE x, VALUE y)
{
- if (cmpint(x, y) > 0) return Qtrue;
- return Qfalse;
+ return RBOOL(cmpint(x, y) > 0);
}
/*
@@ -120,8 +119,7 @@ cmp_gt(VALUE x, VALUE y)
static VALUE
cmp_ge(VALUE x, VALUE y)
{
- if (cmpint(x, y) >= 0) return Qtrue;
- return Qfalse;
+ return RBOOL(cmpint(x, y) >= 0);
}
/*
@@ -135,8 +133,7 @@ cmp_ge(VALUE x, VALUE y)
static VALUE
cmp_lt(VALUE x, VALUE y)
{
- if (cmpint(x, y) < 0) return Qtrue;
- return Qfalse;
+ return RBOOL(cmpint(x, y) < 0);
}
/*
@@ -150,8 +147,7 @@ cmp_lt(VALUE x, VALUE y)
static VALUE
cmp_le(VALUE x, VALUE y)
{
- if (cmpint(x, y) <= 0) return Qtrue;
- return Qfalse;
+ return RBOOL(cmpint(x, y) <= 0);
}
/*