diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-08-06 12:56:18 +0900 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2019-08-06 20:59:19 +0900 |
commit | b5146e375aca25a15ec46978711cde28e5f761d6 (patch) | |
tree | bd85c41b2a077e95476ec35a93d5923706be5559 /vm_insnhelper.c | |
parent | 43b52ac0a52807c415e9d24d25954f5055567c5e (diff) | |
download | ruby-b5146e375aca25a15ec46978711cde28e5f761d6.tar.gz |
leafify opt_plus
Inspired by 346aa557b31fe96760e505d30da26eb7a846bac9
Closes: https://github.com/ruby/ruby/pull/2321
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index e68ded7d15..d7aa5ce57c 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -3848,9 +3848,10 @@ vm_opt_plus(VALUE recv, VALUE obj) else if (RBASIC_CLASS(recv) == rb_cString && RBASIC_CLASS(obj) == rb_cString && BASIC_OP_UNREDEFINED_P(BOP_PLUS, STRING_REDEFINED_OP_FLAG)) { - return rb_str_plus(recv, obj); + return rb_str_opt_plus(recv, obj); } else if (RBASIC_CLASS(recv) == rb_cArray && + RBASIC_CLASS(obj) == rb_cArray && BASIC_OP_UNREDEFINED_P(BOP_PLUS, ARRAY_REDEFINED_OP_FLAG)) { return rb_ary_plus(recv, obj); } |