summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-02-27 11:15:04 -0800
committerJeremy Evans <code@jeremyevans.net>2020-03-17 12:09:43 -0700
commitac04b778c12120ab91986822b71edf16fea61465 (patch)
tree8f1eda4d451709c54c7ed540007218e2488169d4 /hash.c
parent3325194ac0fd9e14ab5535c80b3a9b329d030e76 (diff)
Make {**{}} return unfrozen empty hash
Previously, method call keyword splats and hash keyword splats were compiled exactly the same. This is because parse-wise, they operate on indentical nodes when it comes to compiling the **{}. Fix this by using an ugly hack of temporarily modifying the nd_brace flag in the method call keyword splat case. Inside compile_hash, only optimize the **{} case for hashes where the nd_brace flag has been modified to reflect we are in the method call keyword splat case and it is safe to do so. Since compile_keyword_args is only called in one place, move the keyword_node_p call out of that method to the single caller to avoid duplicating the code.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2945
Diffstat (limited to 'hash.c')
0 files changed, 0 insertions, 0 deletions