diff options
author | Aaron Patterson <tenderlove@ruby-lang.org> | 2021-03-16 15:16:51 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2021-03-17 10:55:37 -0700 |
commit | c3971bea3351e014171910402a220770196ed1cc (patch) | |
tree | 6ff17f2d8df25162eb1f73ec3236286f2b3a756d /vm_insnhelper.c | |
parent | 17bf478de14d0dd9098df65282f7f419cd792599 (diff) |
Stop calling `rb_iseq_defined_string` in vm_defined
We already have access to the string from the iseqs, so we can stop
calling this function.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4279
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 5f8bffb380..81ac2eb273 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -3986,7 +3986,7 @@ check_respond_to_missing(VALUE obj, VALUE v) } static VALUE -vm_defined(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, rb_num_t op_type, VALUE obj, VALUE needstr, VALUE v) +vm_defined(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, rb_num_t op_type, VALUE obj, VALUE v) { VALUE klass; enum defined_type expr_type = DEFINED_NOT_DEFINED; @@ -4081,15 +4081,10 @@ vm_defined(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, rb_num_t op_ } if (expr_type != 0) { - if (needstr != Qfalse) { - return rb_iseq_defined_string(expr_type); - } - else { - return Qtrue; - } + return Qtrue; } else { - return Qnil; + return Qfalse; } } |