mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
Negative RBOOL usage
This commit is contained in:
parent
77ee47188e
commit
069cca6f74
Notes:
git
2022-01-01 18:54:15 +09:00
9 changed files with 14 additions and 14 deletions
8
object.c
8
object.c
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue