diff options
author | Aaron Patterson <tenderlove@ruby-lang.org> | 2020-10-28 09:57:44 -0700 |
---|---|---|
committer | Aaron Patterson <tenderlove@ruby-lang.org> | 2020-10-28 09:57:44 -0700 |
commit | 5be42c1ef4f7ed0a8004cad750a9ce61869bd768 (patch) | |
tree | 246b0b8df04e55e6335b5972d77054db880faa80 | |
parent | 2c19c1484abda749540c5865de4dce5a47fc8f0f (diff) |
Remove unnecessary conditional
As of 0b81a484f3453082d28a48968a063fd907daa5b5, `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
-rw-r--r-- | gc.c | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -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; |