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 /vm_insnhelper.c | |
parent | 77ee47188efc64fe8b508494e9b11e8ed481d33c (diff) |
Negative RBOOL usage
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5385
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index e01d39de77..271b347d3b 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -5205,7 +5205,7 @@ vm_opt_neq(const rb_iseq_t *iseq, CALL_DATA cd, CALL_DATA cd_eq, VALUE recv, VAL VALUE val = opt_equality(iseq, recv, obj, cd_eq); if (val != Qundef) { - return RTEST(val) ? Qfalse : Qtrue; + return RBOOL(!RTEST(val)); } } @@ -5538,7 +5538,7 @@ static VALUE vm_opt_not(const rb_iseq_t *iseq, CALL_DATA cd, VALUE recv) { if (vm_method_cfunc_is(iseq, cd, recv, rb_obj_not)) { - return RTEST(recv) ? Qfalse : Qtrue; + return RBOOL(!RTEST(recv)); } else { return Qundef; |