summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2024-03-26 11:32:09 -0700
committerTakashi Kokubun <[email protected]>2024-03-26 11:33:02 -0700
commit696b2716e0ab7c7df983856216d65bb5f06bf956 (patch)
tree28f87e9e21d7ba7cbae03f9e537c64923d356041 /thread.c
parente16086b7f25d334c8049bd0e237191bdb3300d88 (diff)
Return stdbool from recursive_check()
The return value is used as a boolean value in C. Since it's not used as a Ruby object, it just seems confusing that it returns a VALUE.
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/thread.c b/thread.c
index c798c5a204..1859f727ea 100644
--- a/thread.c
+++ b/thread.c
@@ -5098,12 +5098,12 @@ recursive_list_access(VALUE sym)
}
/*
- * Returns Qtrue if and only if obj (or the pair <obj, paired_obj>) is already
+ * Returns true if and only if obj (or the pair <obj, paired_obj>) is already
* in the recursion list.
* Assumes the recursion list is valid.
*/
-static VALUE
+static bool
recursive_check(VALUE list, VALUE obj, VALUE paired_obj_id)
{
#if SIZEOF_LONG == SIZEOF_VOIDP
@@ -5115,18 +5115,18 @@ recursive_check(VALUE list, VALUE obj, VALUE paired_obj_id)
VALUE pair_list = rb_hash_lookup2(list, obj, Qundef);
if (UNDEF_P(pair_list))
- return Qfalse;
+ return false;
if (paired_obj_id) {
if (!RB_TYPE_P(pair_list, T_HASH)) {
if (!OBJ_ID_EQL(paired_obj_id, pair_list))
- return Qfalse;
+ return false;
}
else {
if (NIL_P(rb_hash_lookup(pair_list, paired_obj_id)))
- return Qfalse;
+ return false;
}
}
- return Qtrue;
+ return true;
}
/*