summaryrefslogtreecommitdiff
path: root/class.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 /class.c
parentdc1c4e46758ace2c9e5e822df0d64b16bb564bb4 (diff)
downloadruby-1f4f6c9832d83e7ebd65ccf4e95cef358b3512c6.tar.gz
Using UNDEF_P macro
Diffstat (limited to 'class.c')
-rw-r--r--class.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/class.c b/class.c
index 85663ada50..b9d62c18b1 100644
--- a/class.c
+++ b/class.c
@@ -64,7 +64,7 @@ push_subclass_entry_to_list(VALUE super, VALUE klass)
void
rb_class_subclass_add(VALUE super, VALUE klass)
{
- if (super && super != Qundef) {
+ if (super && !UNDEF_P(super)) {
rb_subclass_entry_t *entry = push_subclass_entry_to_list(super, klass);
RCLASS_SUBCLASS_ENTRY(klass) = entry;
}
@@ -277,7 +277,7 @@ rb_class_update_superclasses(VALUE klass)
VALUE super = RCLASS_SUPER(klass);
if (!RB_TYPE_P(klass, T_CLASS)) return;
- if (super == Qundef) return;
+ if (UNDEF_P(super)) return;
// If the superclass array is already built
if (RCLASS_SUPERCLASSES(klass))
@@ -608,7 +608,7 @@ rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach)
arg.klass = clone;
rb_id_table_foreach(RCLASS_CONST_TBL(klass), clone_const_i, &arg);
}
- if (attach != Qundef) {
+ if (!UNDEF_P(attach)) {
rb_singleton_class_attached(clone, attach);
}
RCLASS_M_TBL_INIT(clone);