diff options
author | Peter Zhu <peter@peterzhu.ca> | 2024-01-17 15:55:08 -0500 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2024-01-19 10:25:02 -0500 |
commit | d0b774cfb8ddf075c23d1b5ab1fc6f47123ccf65 (patch) | |
tree | 09b3712a3bb799c88ac04f05e21be9a9dcae4936 /thread_pthread.c | |
parent | d29cd972f704b42a25a8de2e5f5380f8aee3144a (diff) |
Remove null checks for xfree
xfree can handle null values, so we don't need to check it.
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/thread_pthread.c b/thread_pthread.c index c90a29a643..1b51872199 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -2327,10 +2327,8 @@ rb_threadptr_sched_free(rb_thread_t *th) // TODO: how to free nt and nt->altstack? } - if (th->sched.context) { - ruby_xfree(th->sched.context); - VM_ASSERT((th->sched.context = NULL) == NULL); - } + ruby_xfree(th->sched.context); + VM_ASSERT((th->sched.context = NULL) == NULL); #else ruby_xfree(th->sched.context_stack); native_thread_destroy(th->nt); |