summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorS.H <gamelinks007@gmail.com>2021-08-02 12:06:44 +0900
committerGitHub <noreply@github.com>2021-08-02 12:06:44 +0900
commit378e8cdad69e6ba995a024da2957719789f0679e (patch)
tree99ffe0f8055bc10cba3225fb5e7a906f5c3f4543 /proc.c
parent3688b476710def7290e32656b200fefc538366d0 (diff)
Using RBOOL macro
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4695 Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/proc.c b/proc.c
index d048ba46f2..823d806ffd 100644
--- a/proc.c
+++ b/proc.c
@@ -169,12 +169,7 @@ rb_proc_alloc(VALUE klass)
VALUE
rb_obj_is_proc(VALUE proc)
{
- if (rb_typeddata_is_kind_of(proc, &proc_data_type)) {
- return Qtrue;
- }
- else {
- return Qfalse;
- }
+ return RBOOL(rb_typeddata_is_kind_of(proc, &proc_data_type));
}
/* :nodoc: */
@@ -295,7 +290,7 @@ rb_proc_lambda_p(VALUE procval)
rb_proc_t *proc;
GetProcPtr(procval, proc);
- return proc->is_lambda ? Qtrue : Qfalse;
+ return RBOOL(proc->is_lambda);
}
/* Binding */
@@ -648,7 +643,7 @@ bind_local_variable_defined_p(VALUE bindval, VALUE sym)
GetBindingPtr(bindval, bind);
env = VM_ENV_ENVVAL_PTR(vm_block_ep(&bind->block));
- return get_local_variable_ptr(&env, lid) ? Qtrue : Qfalse;
+ return RBOOL(get_local_variable_ptr(&env, lid));
}
/*
@@ -1598,12 +1593,7 @@ static const rb_data_type_t method_data_type = {
VALUE
rb_obj_is_method(VALUE m)
{
- if (rb_typeddata_is_kind_of(m, &method_data_type)) {
- return Qtrue;
- }
- else {
- return Qfalse;
- }
+ return RBOOL(rb_typeddata_is_kind_of(m, &method_data_type));
}
static int