diff options
author | Marc-Andre Lafortune <[email protected]> | 2020-12-17 14:43:11 -0500 |
---|---|---|
committer | Marc-André Lafortune <[email protected]> | 2020-12-19 03:59:51 -0500 |
commit | 0d3dc2ec807c313d0952d15ac4f30bc8586bba2f (patch) | |
tree | 622a4359e28f7fe1021dac07708749a90856f209 /hash.c | |
parent | 5611066e03fe73bdbb08cc46f79530c69975cf17 (diff) |
Make `Hash#except` always return a Hash
[Feature #15822]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3929
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -2643,7 +2643,8 @@ rb_hash_except(int argc, VALUE *argv, VALUE hash) int i; VALUE key, result; - result = rb_obj_dup(hash); + result = hash_alloc(rb_cHash); + hash_copy(result, hash); for (i = 0; i < argc; i++) { key = argv[i]; |