diff options
Diffstat (limited to 'enum.c')
-rw-r--r-- | enum.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1069,10 +1069,14 @@ static VALUE enum_tally(int argc, VALUE *argv, VALUE obj) { VALUE hash; - if (rb_check_arity(argc, 0, 1)) - hash = rb_check_hash_type(argv[0]); - else + if (rb_check_arity(argc, 0, 1)) { + hash = rb_convert_type(argv[0], T_HASH, "Hash", "to_hash"); + rb_check_frozen(hash); + } + else { hash = rb_hash_new(); + } + return enum_hashify_into(obj, 0, 0, tally_i, hash); } |