Skip to content

Commit

Permalink
rb_class_inherited_p returns Ruby's true/false/nil
Browse files Browse the repository at this point in the history
From: https://github.com/ruby/ruby/blob/6b86549df8f6d48eeab3c7b48b3fd9ee02f744ba/object.c#L1828-L1846

> Returns <code>nil</code> if there's no relationship between the two.
  • Loading branch information
shyouhei authored and eregon committed Mar 10, 2020
1 parent 41bf282 commit 750aa1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions optional/capi/ext/object_spec.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ static VALUE object_spec_rb_class_inherited_p(VALUE self, VALUE mod, VALUE arg)
static VALUE speced_allocator(VALUE klass) {
VALUE flags = 0;
VALUE instance;
if (rb_class_inherited_p(klass, rb_cString)) {
if (RTEST(rb_class_inherited_p(klass, rb_cString))) {
flags = T_STRING;
} else if (rb_class_inherited_p(klass, rb_cArray)) {
} else if (RTEST(rb_class_inherited_p(klass, rb_cArray))) {
flags = T_ARRAY;
} else {
flags = T_OBJECT;
Expand Down

0 comments on commit 750aa1c

Please sign in to comment.