From f42230ff2210647d480d02a381065359be993015 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 27 Jul 2022 18:42:27 +0900 Subject: Adjust styles [ci skip] --- object.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'object.c') diff --git a/object.c b/object.c index 3a8a07736a..d1743b554b 100644 --- a/object.c +++ b/object.c @@ -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; -- cgit v1.2.1