diff options
author | S.H <gamelinks007@gmail.com> | 2021-09-15 08:11:05 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-15 08:11:05 +0900 |
commit | b8c3a84bddac7366c4e391234b2535253869e885 (patch) | |
tree | 872dfa2014b75fc4c5dadb060900afa118cded71 /thread.c | |
parent | 89242279e61b023a81c58065c62a82de8829d0b3 (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.c | 15 |
1 files changed, 2 insertions, 13 deletions
@@ -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 |