diff options
author | S-H-GAMELINKS <gamelinks007@gmail.com> | 2022-11-15 13:24:08 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-11-16 18:58:33 +0900 |
commit | 1f4f6c9832d83e7ebd65ccf4e95cef358b3512c6 (patch) | |
tree | 823f1ca5409fdd930b05d974cdb70953b6e7e128 /class.c | |
parent | dc1c4e46758ace2c9e5e822df0d64b16bb564bb4 (diff) |
Using UNDEF_P macro
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6721
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); |