summaryrefslogtreecommitdiff
path: root/iseq.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 /iseq.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 'iseq.c')
-rw-r--r--iseq.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/iseq.c b/iseq.c
index d3bd4a22f3..e04642fd92 100644
--- a/iseq.c
+++ b/iseq.c
@@ -503,7 +503,7 @@ rb_iseq_pathobj_new(VALUE path, VALUE realpath)
{
VALUE pathobj;
VM_ASSERT(RB_TYPE_P(path, T_STRING));
- VM_ASSERT(realpath == Qnil || RB_TYPE_P(realpath, T_STRING));
+ VM_ASSERT(NIL_P(realpath) || RB_TYPE_P(realpath, T_STRING));
if (path == realpath ||
(!NIL_P(realpath) && rb_str_cmp(path, realpath) == 0)) {
@@ -759,7 +759,7 @@ rb_iseq_make_compile_option(rb_compile_option_t *option, VALUE opt)
static void
make_compile_option(rb_compile_option_t *option, VALUE opt)
{
- if (opt == Qnil) {
+ if (NIL_P(opt)) {
*option = COMPILE_OPTION_DEFAULT;
}
else if (opt == Qfalse) {
@@ -2413,7 +2413,7 @@ iseq_iterate_children(const rb_iseq_t *iseq, void (*iter_func)(const rb_iseq_t *
UNALIGNED_MEMBER_PTR(body->catch_table, entries[i]);
child = entry->iseq;
if (child) {
- if (rb_hash_aref(all_children, (VALUE)child) == Qnil) {
+ if (NIL_P(rb_hash_aref(all_children, (VALUE)child))) {
rb_hash_aset(all_children, (VALUE)child, Qtrue);
(*iter_func)(child, data);
}
@@ -2432,7 +2432,7 @@ iseq_iterate_children(const rb_iseq_t *iseq, void (*iter_func)(const rb_iseq_t *
case TS_ISEQ:
child = (const rb_iseq_t *)code[i+j+1];
if (child) {
- if (rb_hash_aref(all_children, (VALUE)child) == Qnil) {
+ if (NIL_P(rb_hash_aref(all_children, (VALUE)child))) {
rb_hash_aset(all_children, (VALUE)child, Qtrue);
(*iter_func)(child, data);
}