summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2020-10-28 09:57:44 -0700
committerAaron Patterson <tenderlove@ruby-lang.org>2020-10-28 09:57:44 -0700
commit5be42c1ef4f7ed0a8004cad750a9ce61869bd768 (patch)
tree246b0b8df04e55e6335b5972d77054db880faa80 /gc.c
parent2c19c1484abda749540c5865de4dce5a47fc8f0f (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
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gc.c b/gc.c
index d316febfc1..58541a4091 100644
--- a/gc.c
+++ b/gc.c
@@ -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;