mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
Reuse NIL_OR_UNDEF_P macro
This commit is contained in:
parent
2c939458ca
commit
040e0c8d67
Notes:
git
2022-12-01 16:20:22 +00:00
4 changed files with 4 additions and 4 deletions
2
compar.c
2
compar.c
|
@ -50,7 +50,7 @@ VALUE
|
||||||
rb_invcmp(VALUE x, VALUE y)
|
rb_invcmp(VALUE x, VALUE y)
|
||||||
{
|
{
|
||||||
VALUE invcmp = rb_exec_recursive(invcmp_recursive, x, y);
|
VALUE invcmp = rb_exec_recursive(invcmp_recursive, x, y);
|
||||||
if (UNDEF_P(invcmp) || NIL_P(invcmp)) {
|
if (NIL_OR_UNDEF_P(invcmp)) {
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
2
dir.c
2
dir.c
|
@ -2932,7 +2932,7 @@ dir_globs(VALUE args, VALUE base, int flags)
|
||||||
static VALUE
|
static VALUE
|
||||||
dir_glob_option_base(VALUE base)
|
dir_glob_option_base(VALUE base)
|
||||||
{
|
{
|
||||||
if (UNDEF_P(base) || NIL_P(base)) {
|
if (NIL_OR_UNDEF_P(base)) {
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
#if USE_OPENDIR_AT
|
#if USE_OPENDIR_AT
|
||||||
|
|
2
error.c
2
error.c
|
@ -2084,7 +2084,7 @@ name_err_mesg_to_str(VALUE obj)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
d = rb_protect(name_err_mesg_receiver_name, obj, &state);
|
d = rb_protect(name_err_mesg_receiver_name, obj, &state);
|
||||||
if (state || UNDEF_P(d) || NIL_P(d))
|
if (state || NIL_OR_UNDEF_P(d))
|
||||||
d = rb_protect(rb_inspect, obj, &state);
|
d = rb_protect(rb_inspect, obj, &state);
|
||||||
if (state) {
|
if (state) {
|
||||||
rb_set_errinfo(Qnil);
|
rb_set_errinfo(Qnil);
|
||||||
|
|
2
io.c
2
io.c
|
@ -1424,7 +1424,7 @@ rb_io_wait(VALUE io, VALUE events, VALUE timeout)
|
||||||
struct timeval tv_storage;
|
struct timeval tv_storage;
|
||||||
struct timeval *tv = NULL;
|
struct timeval *tv = NULL;
|
||||||
|
|
||||||
if (timeout == Qnil || UNDEF_P(timeout)) {
|
if (NIL_OR_UNDEF_P(timeout)) {
|
||||||
timeout = fptr->timeout;
|
timeout = fptr->timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue