summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/hash.c b/hash.c
index a52e02ff67..1321b83191 100644
--- a/hash.c
+++ b/hash.c
@@ -1288,9 +1288,7 @@ static int
hash_aset_str(st_data_t *key, st_data_t *val, struct update_arg *arg, int existing)
{
if (!existing) {
- VALUE str = (VALUE)*key;
- if (!OBJ_FROZEN(str))
- *key = rb_fstring(str);
+ *key = rb_str_new_frozen(*key);
}
return hash_aset(key, val, arg, existing);
}