summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2024-09-29 21:03:08 -0400
committerPeter Zhu <peter@peterzhu.ca>2024-09-30 09:09:09 -0400
commit6b8078cc038e926969ec351bceda26182c04654d (patch)
tree7b2e65c14aa8164a0595be1fc97bd66455cf9cbc /test/ruby
parent637067440f74043c6d79fc649ab8acf1afea25a5 (diff)
Don't create empty string for interpolation
We don't need to create an empty string for interpolation unless it is the only element. For example: "#{hello} world" Before: 0000 putobject "" ( 1)[Li] 0002 putself 0003 opt_send_without_block <calldata!mid:hello, argc:0, FCALL|VCALL|ARGS_SIMPLE> 0005 dup 0006 objtostring <calldata!mid:to_s, argc:0, FCALL|ARGS_SIMPLE> 0008 anytostring 0009 putobject " world" 0011 concatstrings 3 0013 leave After: 0000 putself ( 1)[Li] 0001 opt_send_without_block <calldata!mid:hello, argc:0, FCALL|VCALL|ARGS_SIMPLE> 0003 dup 0004 objtostring <calldata!mid:to_s, argc:0, FCALL|ARGS_SIMPLE> 0006 anytostring 0007 putobject " world" 0009 concatstrings 2 0011 leave
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11728
Diffstat (limited to 'test/ruby')
0 files changed, 0 insertions, 0 deletions