diff options
author | Jeremy Evans <code@jeremyevans.net> | 2019-04-01 12:15:01 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2019-08-30 12:39:31 -0700 |
commit | 334b41a46b2a1a72965494dcecc6fe73a83f4490 (patch) | |
tree | ea1373861f84f5ce1844993057c3c5e5649756d9 /vm.c | |
parent | 16c6984bb97409029e213154ac4f633ae04af3d8 (diff) |
Allow ** syntax to be used for calling methods that do not accept keywords
Treat the ** syntax as passing a copy of the hash as the last
positional argument. If the hash being double splatted is empty, do
not add a positional argument.
Remove rb_no_keyword_hash, no longer needed.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2395
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 5 |
1 files changed, 0 insertions, 5 deletions
@@ -2779,9 +2779,6 @@ static VALUE core_hash_merge_kwd(VALUE hash, VALUE kw); static VALUE core_hash_merge(VALUE hash, long argc, const VALUE *argv) { - if (hash == rb_no_keyword_hash) { - hash = rb_hash_new(); - } Check_Type(hash, T_HASH); VM_ASSERT(argc % 2 == 0); rb_hash_bulk_insert(argc, argv, hash); @@ -2815,8 +2812,6 @@ m_core_hash_merge_kwd(VALUE recv, VALUE hash, VALUE kw) static VALUE core_hash_merge_kwd(VALUE hash, VALUE kw) { - if (RHASH_EMPTY_P(hash) && kw == rb_no_keyword_hash) - return rb_no_keyword_hash; rb_hash_foreach(rb_to_hash_type(kw), kwmerge_i, hash); return hash; } |