aboutsummaryrefslogtreecommitdiffstats
path: root/st.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-19 01:35:04 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-19 01:35:04 +0000
commit4e21f58a70569b6fe97e58f7f234f21ee7e2744f (patch)
tree7553612b4b68a8f6bf2572936af3d40ecf6d11ac /st.c
parent482b05a07f17a2dd650b773fc54545b48155eb98 (diff)
downloadruby-4e21f58a70569b6fe97e58f7f234f21ee7e2744f.tar.gz
revert r59359, r59356, r59355, r59354
These caused numerous CI failures I haven't been able to reproduce [ruby-core:82102] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'st.c')
-rw-r--r--st.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/st.c b/st.c
index c983c0291b..c2848b69b6 100644
--- a/st.c
+++ b/st.c
@@ -2092,23 +2092,6 @@ st_rehash(st_table *tab)
}
#ifdef RUBY
-
-static VALUE
-str_key(VALUE key)
-{
- VALUE k;
-
- if (RB_OBJ_FROZEN(key)) {
- return key;
- }
- if ((k = rb_fstring_existing(key)) != Qnil) {
- return k;
- }
- else {
- return rb_str_new_frozen(key);
- }
-}
-
/* Mimics ruby's { foo => bar } syntax. This function is placed here
because it touches table internals and write barriers at once. */
void
@@ -2131,7 +2114,8 @@ rb_hash_bulk_insert(long argc, const VALUE *argv, VALUE hash)
for (i = 0; i < argc; /* */) {
VALUE key = argv[i++];
VALUE val = argv[i++];
- st_data_t k = (rb_obj_class(key) == rb_cString) ? str_key(key) : key;
+ st_data_t k = (rb_obj_class(key) == rb_cString) ?
+ rb_str_new_frozen(key) : key;
st_table_entry e;
e.hash = do_hash(k, tab);
e.key = k;