[前][次][番号順一覧][スレッド一覧]

ruby-changes:53160

From: nobu <ko1@a...>
Date: Fri, 26 Oct 2018 15:41:39 +0900 (JST)
Subject: [ruby-changes:53160] nobu:r65374 (trunk): Fix a condition and just call rb_fstring [Feature #15251]

nobu	2018-10-26 15:41:34 +0900 (Fri, 26 Oct 2018)

  New Revision: 65374

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65374

  Log:
    Fix a condition and just call rb_fstring [Feature #15251]

  Modified files:
    trunk/hash.c
Index: hash.c
===================================================================
--- hash.c	(revision 65373)
+++ hash.c	(revision 65374)
@@ -1564,25 +1564,11 @@ hash_aset(st_data_t *key, st_data_t *val https://github.com/ruby/ruby/blob/trunk/hash.c#L1564
     return ST_CONTINUE;
 }
 
-static VALUE
-fstring_key_str(VALUE str)
-{
-    st_data_t fstr;
-    st_table *tbl = rb_vm_fstring_table();
-
-    if (st_lookup(tbl, str, &fstr) && !rb_objspace_garbage_object_p(fstr)) {
-        return (VALUE)fstr;
-    }
-    else {
-        return rb_fstring(str);
-    }
-}
-
 VALUE
 rb_hash_key_str(VALUE key)
 {
-    if (!FL_ANY_RAW(key, FL_TAINT|FL_SINGLETON)) {
-        return fstring_key_str(key);
+    if (!RB_FL_ANY_RAW(key, FL_TAINT|FL_EXIVAR) && RBASIC_CLASS(key) == rb_cString) {
+        return rb_fstring(key);
     }
     else {
 	return rb_str_new_frozen(key);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]