diff options
author | S-H-GAMELINKS <gamelinks007@gmail.com> | 2022-06-14 21:49:24 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-06-17 11:59:49 +0900 |
commit | 51a3ebf4ec6182ee516992dc761950d19a7b697b (patch) | |
tree | bbb186ac3d84422fd9d64c261b9a24c4b74c3e3e /compar.c | |
parent | 1dfe007e1696128ff0d3ec78e54d3406073f7727 (diff) |
Using RBOOL in cmp_between func
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6017
Diffstat (limited to 'compar.c')
-rw-r--r-- | compar.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -167,9 +167,7 @@ cmp_le(VALUE x, VALUE y) static VALUE cmp_between(VALUE x, VALUE min, VALUE max) { - if (cmpint(x, min) < 0) return Qfalse; - if (cmpint(x, max) > 0) return Qfalse; - return Qtrue; + return RBOOL((cmpint(x, min) >= 0 && cmpint(x, max) <= 0)); } /* |