diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-24 22:39:56 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-24 22:39:56 +0000 |
commit | 7c8b79755b02c69cc92ab1ca99e175a06ecbdc55 (patch) | |
tree | d7510100c368e866d290e790a6b221e6d3c51da7 /encoding.c | |
parent | 7e669f40bed629ac746ac62ece63e3d4ce6ff039 (diff) | |
download | bundler-7c8b79755b02c69cc92ab1ca99e175a06ecbdc55.tar.gz |
load.c: use fstring instead of OBJ_FREEZE
These strings already exist (or will exist soon) in the fstring
table, so avoid the duplicate, sooner.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
-rw-r--r-- | encoding.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/encoding.c b/encoding.c index f2f34406b5..9d4fcf77e4 100644 --- a/encoding.c +++ b/encoding.c @@ -661,7 +661,7 @@ load_encoding(const char *name) ++s; } FL_UNSET(enclib, FL_TAINT); - OBJ_FREEZE(enclib); + enclib = rb_fstring(enclib); ruby_verbose = Qfalse; ruby_debug = Qfalse; errinfo = rb_errinfo(); @@ -1162,8 +1162,7 @@ enc_names_i(st_data_t name, st_data_t idx, st_data_t args) VALUE *arg = (VALUE *)args; if ((int)idx == (int)arg[0]) { - VALUE str = rb_usascii_str_new2((char *)name); - OBJ_FREEZE(str); + VALUE str = rb_fstring_cstr((char *)name); rb_ary_push(arg[1], str); } return ST_CONTINUE; @@ -1697,8 +1696,7 @@ rb_enc_aliases_enc_i(st_data_t name, st_data_t orig, st_data_t arg) str = rb_fstring_cstr(rb_enc_name(enc)); rb_ary_store(ary, idx, str); } - key = rb_usascii_str_new2((char *)name); - OBJ_FREEZE(key); + key = rb_fstring_cstr((char *)name); rb_hash_aset(aliases, key, str); return ST_CONTINUE; } |