From 7c8b79755b02c69cc92ab1ca99e175a06ecbdc55 Mon Sep 17 00:00:00 2001 From: normal Date: Wed, 24 Jan 2018 22:39:56 +0000 Subject: 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 --- encoding.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'encoding.c') 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; } -- cgit v1.2.3