Skip to content

Commit 59f7a5d

Browse files
committed
Remove meaningless NULL checks
In this context, `th` must not be NULL
1 parent 200f93b commit 59f7a5d

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

vm.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3104,20 +3104,16 @@ ruby_vm_destruct(rb_vm_t *vm)
31043104
rb_id_table_free(vm->constant_cache);
31053105
st_free_table(vm->unused_block_warning_table);
31063106

3107-
if (th) {
3108-
xfree(th->nt);
3109-
th->nt = NULL;
3110-
}
3107+
xfree(th->nt);
3108+
th->nt = NULL;
31113109

31123110
#ifndef HAVE_SETPROCTITLE
31133111
ruby_free_proctitle();
31143112
#endif
31153113
}
31163114
else {
3117-
if (th) {
3118-
rb_fiber_reset_root_local_storage(th);
3119-
thread_free(th);
3120-
}
3115+
rb_fiber_reset_root_local_storage(th);
3116+
thread_free(th);
31213117
}
31223118

31233119
struct rb_objspace *objspace = vm->gc.objspace;

0 commit comments

Comments
 (0)