From d0b774cfb8ddf075c23d1b5ab1fc6f47123ccf65 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 17 Jan 2024 15:55:08 -0500 Subject: Remove null checks for xfree xfree can handle null values, so we don't need to check it. --- thread_pthread.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'thread_pthread.c') 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); -- cgit v1.2.3