summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorYusuke Endoh <[email protected]>2024-12-04 11:44:28 +0900
committerYusuke Endoh <[email protected]>2024-12-04 12:15:23 +0900
commit59f7a5d336ade910626f88f8c2c33a4b8bd54bad (patch)
treef68f39d242671e4cb68254acdbaf896e119e1b52 /vm.c
parent200f93b064cb2cd9e63bc1b3f3e6f0701933aa29 (diff)
Remove meaningless NULL checks
In this context, `th` must not be NULL
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12253
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/vm.c b/vm.c
index df5d81bb18..34a1ef52ce 100644
--- a/vm.c
+++ b/vm.c
@@ -3104,20 +3104,16 @@ ruby_vm_destruct(rb_vm_t *vm)
rb_id_table_free(vm->constant_cache);
st_free_table(vm->unused_block_warning_table);
- if (th) {
- xfree(th->nt);
- th->nt = NULL;
- }
+ xfree(th->nt);
+ th->nt = NULL;
#ifndef HAVE_SETPROCTITLE
ruby_free_proctitle();
#endif
}
else {
- if (th) {
- rb_fiber_reset_root_local_storage(th);
- thread_free(th);
- }
+ rb_fiber_reset_root_local_storage(th);
+ thread_free(th);
}
struct rb_objspace *objspace = vm->gc.objspace;