summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorS-H-GAMELINKS <gamelinks007@gmail.com>2022-11-15 13:24:08 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-11-16 18:58:33 +0900
commit1f4f6c9832d83e7ebd65ccf4e95cef358b3512c6 (patch)
tree823f1ca5409fdd930b05d974cdb70953b6e7e128 /object.c
parentdc1c4e46758ace2c9e5e822df0d64b16bb564bb4 (diff)
downloadruby-1f4f6c9832d83e7ebd65ccf4e95cef358b3512c6.tar.gz
Using UNDEF_P macro
Diffstat (limited to 'object.c')
-rw-r--r--object.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/object.c b/object.c
index f0117d1a47..7f4404c462 100644
--- a/object.c
+++ b/object.c
@@ -125,7 +125,7 @@ rb_equal(VALUE obj1, VALUE obj2)
if (obj1 == obj2) return Qtrue;
result = rb_equal_opt(obj1, obj2);
- if (result == Qundef) {
+ if (UNDEF_P(result)) {
result = rb_funcall(obj1, id_eq, 1, obj2);
}
return RBOOL(RTEST(result));
@@ -138,7 +138,7 @@ rb_eql(VALUE obj1, VALUE obj2)
if (obj1 == obj2) return TRUE;
result = rb_eql_opt(obj1, obj2);
- if (result == Qundef) {
+ if (UNDEF_P(result)) {
result = rb_funcall(obj1, id_eql, 1, obj2);
}
return RTEST(result);
@@ -411,7 +411,7 @@ rb_get_freeze_opt(int argc, VALUE *argv)
rb_scan_args(argc, argv, "0:", &opt);
if (!NIL_P(opt)) {
rb_get_kwargs(opt, keyword_ids, 0, 1, &kwfreeze);
- if (kwfreeze != Qundef)
+ if (!UNDEF_P(kwfreeze))
kwfreeze = obj_freeze_opt(kwfreeze);
}
return kwfreeze;
@@ -2545,7 +2545,7 @@ rb_mod_const_defined(int argc, VALUE *argv, VALUE mod)
#if 0
mod = rb_const_search(mod, id, beglen > 0 || !RTEST(recur), RTEST(recur), FALSE);
- if (mod == Qundef) return Qfalse;
+ if (UNDEF_P(mod)) return Qfalse;
#else
if (!RTEST(recur)) {
if (!rb_const_defined_at(mod, id))
@@ -2975,7 +2975,7 @@ static VALUE
convert_type_with_id(VALUE val, const char *tname, ID method, int raise, int index)
{
VALUE r = rb_check_funcall(val, method, 0, 0);
- if (r == Qundef) {
+ if (UNDEF_P(r)) {
if (raise) {
const char *msg =
((index < 0 ? conv_method_index(rb_id2name(method)) : index)