diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-01-01 15:41:00 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-01-01 17:02:04 +0900 |
commit | 069cca6f7459da5cc502d0c51f60a9813c611b31 (patch) | |
tree | e33986c53af62142b310b187fdf50abea2aa5203 /object.c | |
parent | 77ee47188efc64fe8b508494e9b11e8ed481d33c (diff) | |
download | ruby-069cca6f7459da5cc502d0c51f60a9813c611b31.tar.gz |
Negative RBOOL usage
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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); } |