diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-07-27 18:42:27 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-07-27 18:42:27 +0900 |
commit | f42230ff2210647d480d02a381065359be993015 (patch) | |
tree | b56f825079885aa90cb274bf76a602bafdeec0e8 /object.c | |
parent | 8b9d4b2ce64d496454428292b8d723878906c966 (diff) | |
download | ruby-f42230ff2210647d480d02a381065359be993015.tar.gz |
Adjust styles [ci skip]
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1623,16 +1623,19 @@ rb_class_inherited_p(VALUE mod, VALUE arg) return RCLASS_SUPERCLASSES(mod)[arg_depth] == arg ? Qtrue : Qnil; - } else if (arg_depth > mod_depth) { + } + else if (arg_depth > mod_depth) { // check if mod > arg return RCLASS_SUPERCLASSES(arg)[mod_depth] == mod ? Qfalse : Qnil; - } else { + } + else { // Depths match, and we know they aren't equal: no relation return Qnil; } - } else { + } + else { if (!CLASS_OR_MODULE_P(arg) && !RB_TYPE_P(arg, T_ICLASS)) { rb_raise(rb_eTypeError, "compared with non class/module"); } @@ -2025,7 +2028,8 @@ rb_class_superclass(VALUE klass) if (!super) { if (klass == rb_cBasicObject) return Qnil; rb_raise(rb_eTypeError, "uninitialized class"); - } else { + } + else { super = RCLASS_SUPERCLASSES(klass)[RCLASS_SUPERCLASS_DEPTH(klass) - 1]; RUBY_ASSERT(RB_TYPE_P(klass, T_CLASS)); return super; |