mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix a condition and just call rb_fstring [Feature #15251]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ea9961f9be
commit
300ac6c573
1 changed files with 2 additions and 16 deletions
18
hash.c
18
hash.c
|
@ -1564,25 +1564,11 @@ hash_aset(st_data_t *key, st_data_t *val, struct update_arg *arg, int existing)
|
||||||
return ST_CONTINUE;
|
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
|
VALUE
|
||||||
rb_hash_key_str(VALUE key)
|
rb_hash_key_str(VALUE key)
|
||||||
{
|
{
|
||||||
if (!FL_ANY_RAW(key, FL_TAINT|FL_SINGLETON)) {
|
if (!RB_FL_ANY_RAW(key, FL_TAINT|FL_EXIVAR) && RBASIC_CLASS(key) == rb_cString) {
|
||||||
return fstring_key_str(key);
|
return rb_fstring(key);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return rb_str_new_frozen(key);
|
return rb_str_new_frozen(key);
|
||||||
|
|
Loading…
Add table
Reference in a new issue