Skip to content

Commit

Permalink
Remove unnecessary conditional
Browse files Browse the repository at this point in the history
As of 0b81a48, `ROBJECT_IVPTR` will
always return a value, so we don't need to test whether or not we got
one.  T_OBJECTs always come to life as embedded objects, so they will
return an ivptr, and when they become "unembedded" they will have an
ivptr at that point too
  • Loading branch information
tenderlove committed Oct 28, 2020
1 parent 2c19c14 commit 5be42c1
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions gc.c
Expand Up @@ -5702,16 +5702,14 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj)
{
const VALUE * const ptr = ROBJECT_IVPTR(obj);

if (ptr) {
uint32_t i, len = ROBJECT_NUMIV(obj);
for (i = 0; i < len; i++) {
gc_mark(objspace, ptr[i]);
}
uint32_t i, len = ROBJECT_NUMIV(obj);
for (i = 0; i < len; i++) {
gc_mark(objspace, ptr[i]);
}

if (LIKELY(during_gc) &&
if (LIKELY(during_gc) &&
ROBJ_TRANSIENT_P(obj)) {
rb_transient_heap_mark(obj, ptr);
}
rb_transient_heap_mark(obj, ptr);
}
}
break;
Expand Down

0 comments on commit 5be42c1

Please sign in to comment.