Negative RBOOL usage

This commit is contained in:
Nobuyoshi Nakada 2022-01-01 15:41:00 +09:00
parent 77ee47188e
commit 069cca6f74
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
Notes: git 2022-01-01 18:54:15 +09:00
9 changed files with 14 additions and 14 deletions

View file

@ -204,7 +204,7 @@ VALUE rb_obj_hash(VALUE obj);
MJIT_FUNC_EXPORTED VALUE
rb_obj_not(VALUE obj)
{
return RTEST(obj) ? Qfalse : Qtrue;
return RBOOL(!RTEST(obj));
}
/**
@ -221,7 +221,7 @@ MJIT_FUNC_EXPORTED VALUE
rb_obj_not_equal(VALUE obj1, VALUE obj2)
{
VALUE result = rb_funcall(obj1, id_eq, 1, obj2);
return RTEST(result) ? Qfalse : Qtrue;
return rb_obj_not(result);
}
VALUE
@ -1295,7 +1295,7 @@ true_or(VALUE obj, VALUE obj2)
static VALUE
true_xor(VALUE obj, VALUE obj2)
{
return RTEST(obj2)?Qfalse:Qtrue;
return rb_obj_not(obj2);
}
@ -1426,7 +1426,7 @@ static VALUE
rb_obj_not_match(VALUE obj1, VALUE obj2)
{
VALUE result = rb_funcall(obj1, id_match, 1, obj2);
return RTEST(result) ? Qfalse : Qtrue;
return rb_obj_not(result);
}