diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-14 08:43:51 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-14 08:43:51 +0000 |
commit | 146bb252a0fe114befe8aa762596563c886db7fc (patch) | |
tree | dcd888371a9becf4e80a889103d143fd7165c26e /test/ruby/test_keyword.rb | |
parent | 9800fc26b0367c63ada516b932b13268bb79524b (diff) |
compile.c (setup_args): process arguments forward
For unknown reason, setup_args processed the arguments from the last to
the first. This is not only difficult to read, but also inefficient in
some cases. For example, the arguments of `foo(*a1, *a2, *a3)` was
compiled like `a1.dup << (a2.dup << a3)`. The second dup (`a2.dup`) is
not needed.
This change refactors the function so that it processes the arguments
forward: `foo(*a1, *a2, *a3)` is compiled as `a1.dup << a2 << a3`, and
in my opinion, the source code is now much more readable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_keyword.rb')
0 files changed, 0 insertions, 0 deletions