aboutsummaryrefslogtreecommitdiffstats
path: root/vm.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-04-01 12:15:01 -0700
committerJeremy Evans <code@jeremyevans.net>2019-08-30 12:39:31 -0700
commit334b41a46b2a1a72965494dcecc6fe73a83f4490 (patch)
treeea1373861f84f5ce1844993057c3c5e5649756d9 /vm.c
parent16c6984bb97409029e213154ac4f633ae04af3d8 (diff)
downloadruby-334b41a46b2a1a72965494dcecc6fe73a83f4490.tar.gz
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.
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/vm.c b/vm.c
index c727554483..cbd7b31f3e 100644
--- a/vm.c
+++ b/vm.c
@@ -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;
}