Skip to content

Commit

Permalink
Repalce to NIL_P macro
Browse files Browse the repository at this point in the history
  • Loading branch information
S-H-GAMELINKS authored and nobu committed Aug 19, 2022
1 parent 35c794b commit f095361
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -13612,7 +13612,7 @@ ripper_validate_object(VALUE self, VALUE x)
{
if (x == Qfalse) return x;
if (x == Qtrue) return x;
if (x == Qnil) return x;
if (NIL_P(x)) return x;
if (x == Qundef)
rb_raise(rb_eArgError, "Qundef given");
if (FIXNUM_P(x)) return x;
Expand Down
2 changes: 1 addition & 1 deletion variable.c
Original file line number Diff line number Diff line change
Expand Up @@ -2605,7 +2605,7 @@ autoload_load_needed(VALUE _arguments)
return Qfalse;
}

if (autoload_data->mutex == Qnil) {
if (NIL_P(autoload_data->mutex)) {
autoload_data->mutex = rb_mutex_new();
autoload_data->fork_gen = GET_VM()->fork_gen;
}
Expand Down
2 changes: 1 addition & 1 deletion vm_insnhelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -4841,7 +4841,7 @@ vm_objtostring(const rb_iseq_t *iseq, VALUE recv, CALL_DATA cd)
// going to use this string for interpolation, it's fine to use the
// frozen string.
VALUE val = rb_mod_name(recv);
if (val == Qnil) {
if (NIL_P(val)) {
val = rb_mod_to_s(recv);
}
return val;
Expand Down

0 comments on commit f095361

Please sign in to comment.