summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorS.H <gamelinks007@gmail.com>2021-09-15 08:11:05 +0900
committerGitHub <noreply@github.com>2021-09-15 08:11:05 +0900
commitb8c3a84bddac7366c4e391234b2535253869e885 (patch)
tree872dfa2014b75fc4c5dadb060900afa118cded71 /thread.c
parent89242279e61b023a81c58065c62a82de8829d0b3 (diff)
Refactor and Using RBOOL macro
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4837 Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/thread.c b/thread.c
index 7e1c1a65bb..9008467206 100644
--- a/thread.c
+++ b/thread.c
@@ -3370,13 +3370,7 @@ rb_thread_stop_p(VALUE thread)
if (rb_threadptr_dead(th)) {
return Qtrue;
}
- else if (th->status == THREAD_STOPPED ||
- th->status == THREAD_STOPPED_FOREVER) {
- return Qtrue;
- }
- else {
- return Qfalse;
- }
+ return RBOOL(th->status == THREAD_STOPPED || th->status == THREAD_STOPPED_FOREVER);
}
/*
@@ -3770,12 +3764,7 @@ rb_thread_key_p(VALUE self, VALUE key)
if (!id || local_storage == NULL) {
return Qfalse;
}
- else if (rb_id_table_lookup(local_storage, id, &val)) {
- return Qtrue;
- }
- else {
- return Qfalse;
- }
+ return RBOOL(rb_id_table_lookup(local_storage, id, &val));
}
static enum rb_id_table_iterator_result