ruby-changes:51565
From: nobu <ko1@a...>
Date: Fri, 29 Jun 2018 00:39:49 +0900 (JST)
Subject: [ruby-changes:51565] nobu:r63776 (trunk): symbol.c: dsymbol initial encoding
nobu 2018-06-28 16:34:36 +0900 (Thu, 28 Jun 2018) New Revision: 63776 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63776 Log: symbol.c: dsymbol initial encoding * symbol.c (dsymbol_alloc): set encoding directly. no need to check existing encoding in rb_enc_associate. Modified files: trunk/symbol.c Index: symbol.c =================================================================== --- symbol.c (revision 63775) +++ symbol.c (revision 63776) @@ -509,7 +509,7 @@ dsymbol_alloc(const VALUE klass, const V https://github.com/ruby/ruby/blob/trunk/symbol.c#L509 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/