ruby-changes:40933
From: nobu <ko1@a...>
Date: Thu, 10 Dec 2015 03:15:27 +0900 (JST)
Subject: [ruby-changes:40933] nobu:r53012 (trunk): dir.c, io.c: use rb_id_encoding
nobu 2015-12-10 03:15:04 +0900 (Thu, 10 Dec 2015) New Revision: 53012 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53012 Log: dir.c, io.c: use rb_id_encoding * dir.c (dir_initialize): rb_id_encoding() returns same ID with caching. * io.c (Init_IO): ditto. Modified files: trunk/dir.c trunk/io.c Index: io.c =================================================================== --- io.c (revision 53011) +++ io.c (revision 53012) @@ -12494,7 +12494,7 @@ Init_IO(void) https://github.com/ruby/ruby/blob/trunk/io.c#L12494 sym_flags = ID2SYM(rb_intern("flags")); sym_extenc = ID2SYM(rb_intern("external_encoding")); sym_intenc = ID2SYM(rb_intern("internal_encoding")); - sym_encoding = ID2SYM(rb_intern("encoding")); + sym_encoding = ID2SYM(rb_id_encoding()); sym_open_args = ID2SYM(rb_intern("open_args")); sym_textmode = ID2SYM(rb_intern("textmode")); sym_binmode = ID2SYM(rb_intern("binmode")); Index: dir.c =================================================================== --- dir.c (revision 53011) +++ dir.c (revision 53012) @@ -491,7 +491,7 @@ dir_initialize(int argc, VALUE *argv, VA https://github.com/ruby/ruby/blob/trunk/dir.c#L491 const char *path; if (!keyword_ids[0]) { - keyword_ids[0] = rb_intern("encoding"); + keyword_ids[0] = rb_id_encoding(); } fsenc = rb_filesystem_encoding(); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/