diff options
author | Jeremy Evans <[email protected]> | 2019-04-01 12:15:01 -0700 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2019-08-30 12:39:31 -0700 |
commit | 334b41a46b2a1a72965494dcecc6fe73a83f4490 (patch) | |
tree | ea1373861f84f5ce1844993057c3c5e5649756d9 /hash.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 'hash.c')
-rw-r--r-- | hash.c | 8 |
1 files changed, 0 insertions, 8 deletions
@@ -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); |