summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
authorS.H <gamelinks007@gmail.com>2021-10-03 22:34:45 +0900
committerGitHub <noreply@github.com>2021-10-03 22:34:45 +0900
commitdc9112cf10e63b5272e9469d080d5d1ced30276e (patch)
tree2970b172b25b303dd839fced592564a77eedeab1 /range.c
parentfb03598666ddbb9f8b35eb4f599e75654ca7ca06 (diff)
Using NIL_P macro instead of `== Qnil`
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4925 Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'range.c')
-rw-r--r--range.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/range.c b/range.c
index 6f44e82600..31f734181d 100644
--- a/range.c
+++ b/range.c
@@ -642,7 +642,7 @@ bsearch_integer_range(VALUE beg, VALUE end, int excl)
satisfied = val; \
smaller = 1; \
} \
- else if (v == Qfalse || v == Qnil) { \
+ else if (!RTEST(v)) { \
smaller = 0; \
} \
else if (rb_obj_is_kind_of(v, rb_cNumeric)) { \
@@ -1952,7 +1952,7 @@ r_cover_range_p(VALUE range, VALUE beg, VALUE end, VALUE val)
}
val_max = rb_rescue2(r_call_max, val, 0, Qnil, rb_eTypeError, (VALUE)0);
- if (val_max == Qnil) return FALSE;
+ if (NIL_P(val_max)) return FALSE;
return r_less(end, val_max) >= 0;
}