summaryrefslogtreecommitdiff
path: root/symbol.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-28 07:34:36 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-28 07:34:36 (GMT)
commit40efaab3012188e159d0f6e104371c22fc3fcafd (patch)
tree03e7b29aa66ccd3bfb1a0270ce72af2eb216bf80 /symbol.c
parentc6d5b61745b40076985ff50c20a2aea907df7fce (diff)
symbol.c: dsymbol initial encoding
* symbol.c (dsymbol_alloc): set encoding directly. no need to check existing encoding in rb_enc_associate. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'symbol.c')
-rw-r--r--symbol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/symbol.c b/symbol.c
index c54a743..d7fedf5 100644
--- a/symbol.c
+++ b/symbol.c
@@ -509,7 +509,7 @@ dsymbol_alloc(const VALUE klass, const VALUE str, rb_encoding * const enc, const
const VALUE dsym = rb_newobj_of(klass, T_SYMBOL | FL_WB_PROTECTED);
long hashval;
- rb_enc_associate(dsym, enc);
+ rb_enc_set_index(dsym, rb_enc_to_index(enc));
OBJ_FREEZE(dsym);
RB_OBJ_WRITE(dsym, &RSYMBOL(dsym)->fstr, str);
RSYMBOL(dsym)->id = type;