diff options
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 23 |
1 files changed, 1 insertions, 22 deletions
@@ -18,7 +18,6 @@ #include "probes.h" #include "id.h" #include "symbol.h" -#include "gc.h" #ifdef __APPLE__ # ifdef HAVE_CRT_EXTERNS_H @@ -1516,33 +1515,13 @@ hash_aset(st_data_t *key, st_data_t *val, struct update_arg *arg, int existing) return ST_CONTINUE; } -static VALUE -fstring_existing_str(VALUE str) -{ - st_data_t fstr; - st_table *tbl = rb_vm_fstring_table(); - - if (st_lookup(tbl, str, &fstr)) { - if (rb_objspace_garbage_object_p(fstr)) { - return rb_fstring(str); - } - else { - return (VALUE)fstr; - } - } - else { - return Qnil; - } -} - static int hash_aset_str(st_data_t *key, st_data_t *val, struct update_arg *arg, int existing) { if (!existing && !RB_OBJ_FROZEN(*key)) { VALUE k; - if (!RB_OBJ_TAINTED(*key) && - (k = fstring_existing_str(*key)) != Qnil) { + if ((k = rb_fstring_existing(*key)) != Qnil) { *key = k; } else { |