diff options
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1015,12 +1015,11 @@ VALUE rb_hash_aset(VALUE hash, VALUE key, VALUE val) { rb_hash_modify(hash); - if (RHASH(hash)->ntbl->type == &identhash || - rb_obj_class(key) != rb_cString || st_lookup(RHASH(hash)->ntbl, key, 0)) { + if (RHASH(hash)->ntbl->type == &identhash || rb_obj_class(key) != rb_cString) { st_insert(RHASH(hash)->ntbl, key, val); } else { - st_add_direct(RHASH(hash)->ntbl, rb_str_new4(key), val); + st_insert2(RHASH(hash)->ntbl, key, val, rb_str_new4); } return val; } |