summaryrefslogtreecommitdiff
path: root/hash.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 /hash.c
parent16c6984bb97409029e213154ac4f633ae04af3d8 (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 'hash.c')
-rw-r--r--hash.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/hash.c b/hash.c
index 0f1c460c49..b61784af3a 100644
--- a/hash.c
+++ b/hash.c
@@ -30,8 +30,6 @@
# endif
#endif
-VALUE rb_no_keyword_hash;
-
#ifndef HASH_DEBUG
#define HASH_DEBUG 0
#endif
@@ -3276,8 +3274,6 @@ inspect_hash(VALUE hash, VALUE dummy, int recur)
static VALUE
rb_hash_inspect(VALUE hash)
{
- if (hash == rb_no_keyword_hash)
- return rb_usascii_str_new2("{(NO KEYWORD)}");
if (RHASH_EMPTY_P(hash))
return rb_usascii_str_new2("{}");
return rb_exec_recursive(inspect_hash, hash, 0);
@@ -6277,10 +6273,6 @@ Init_Hash(void)
*/
rb_define_global_const("ENV", envtbl);
- rb_no_keyword_hash = rb_hash_new();
- rb_hash_freeze(rb_no_keyword_hash);
- rb_gc_register_mark_object(rb_no_keyword_hash);
-
/* for callcc */
ruby_register_rollback_func_for_ensure(hash_foreach_ensure, hash_foreach_ensure_rollback);