ruby-changes:35830
From: nobu <ko1@a...>
Date: Tue, 14 Oct 2014 16:23:13 +0900 (JST)
Subject: [ruby-changes:35830] nobu:r47912 (trunk): symbol.c: rename rb_str_dynamic_intern
nobu 2014-10-14 16:23:01 +0900 (Tue, 14 Oct 2014) New Revision: 47912 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47912 Log: symbol.c: rename rb_str_dynamic_intern * iseq.c, marshal.c, string.c: use rb_str_intern instead of rb_str_dynamic_intern. * symbol.c (rb_str_intern): rename rb_str_dynamic_intern. Modified files: trunk/ChangeLog trunk/internal.h trunk/iseq.c trunk/marshal.c trunk/string.c trunk/symbol.c Index: symbol.c =================================================================== --- symbol.c (revision 47911) +++ symbol.c (revision 47912) @@ -155,7 +155,7 @@ rb_id_attrset(ID id) https://github.com/ruby/ruby/blob/trunk/symbol.c#L155 /* make new dynamic symbol */ str = rb_str_dup(RSYMBOL((VALUE)id)->fstr); rb_str_cat(str, "=", 1); - id = SYM2ID(rb_str_dynamic_intern(str)); + id = SYM2ID(rb_str_intern(str)); } return id; } @@ -741,7 +741,7 @@ rb_gc_free_dsymbol(VALUE sym) https://github.com/ruby/ruby/blob/trunk/symbol.c#L741 */ VALUE -rb_str_dynamic_intern(VALUE str) +rb_str_intern(VALUE str) { #if USE_SYMBOL_GC rb_encoding *enc, *ascii; Index: ChangeLog =================================================================== --- ChangeLog (revision 47911) +++ ChangeLog (revision 47912) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Oct 14 16:22:59 2014 Nobuyoshi Nakada <nobu@r...> + + * iseq.c, marshal.c, string.c: use rb_str_intern instead of + rb_str_dynamic_intern. + + * symbol.c (rb_str_intern): rename rb_str_dynamic_intern. + Tue Oct 14 10:19:10 2014 Eric Wong <e@8...> * test/ruby/test_optimization.rb (test_string_freeze): new test Index: iseq.c =================================================================== --- iseq.c (revision 47911) +++ iseq.c (revision 47912) @@ -1617,7 +1617,7 @@ ruby_node_name(int node) https://github.com/ruby/ruby/blob/trunk/iseq.c#L1617 static VALUE register_label(struct st_table *table, unsigned long idx) { - VALUE sym = rb_str_dynamic_intern(rb_sprintf("label_%lu", idx)); + VALUE sym = rb_str_intern(rb_sprintf("label_%lu", idx)); st_insert(table, idx, sym); return sym; } Index: string.c =================================================================== --- string.c (revision 47911) +++ string.c (revision 47912) @@ -7548,16 +7548,6 @@ rb_str_crypt(VALUE str, VALUE salt) https://github.com/ruby/ruby/blob/trunk/string.c#L7548 } -VALUE -rb_str_intern(VALUE str) -{ - ID id; - - id = rb_intern_str(str); - return ID2SYM(id); -} - - /* * call-seq: * str.ord -> integer @@ -8633,7 +8623,7 @@ sym_to_proc(VALUE sym) https://github.com/ruby/ruby/blob/trunk/string.c#L8623 static VALUE sym_succ(VALUE sym) { - return rb_str_dynamic_intern(rb_str_succ(rb_sym2str(sym))); + return rb_str_intern(rb_str_succ(rb_sym2str(sym))); } /* @@ -8743,7 +8733,7 @@ sym_empty(VALUE sym) https://github.com/ruby/ruby/blob/trunk/string.c#L8733 static VALUE sym_upcase(VALUE sym) { - return rb_str_dynamic_intern(rb_str_upcase(rb_sym2str(sym))); + return rb_str_intern(rb_str_upcase(rb_sym2str(sym))); } /* @@ -8756,7 +8746,7 @@ sym_upcase(VALUE sym) https://github.com/ruby/ruby/blob/trunk/string.c#L8746 static VALUE sym_downcase(VALUE sym) { - return rb_str_dynamic_intern(rb_str_downcase(rb_sym2str(sym))); + return rb_str_intern(rb_str_downcase(rb_sym2str(sym))); } /* @@ -8769,7 +8759,7 @@ sym_downcase(VALUE sym) https://github.com/ruby/ruby/blob/trunk/string.c#L8759 static VALUE sym_capitalize(VALUE sym) { - return rb_str_dynamic_intern(rb_str_capitalize(rb_sym2str(sym))); + return rb_str_intern(rb_str_capitalize(rb_sym2str(sym))); } /* @@ -8782,7 +8772,7 @@ sym_capitalize(VALUE sym) https://github.com/ruby/ruby/blob/trunk/string.c#L8772 static VALUE sym_swapcase(VALUE sym) { - return rb_str_dynamic_intern(rb_str_swapcase(rb_sym2str(sym))); + return rb_str_intern(rb_str_swapcase(rb_sym2str(sym))); } /* @@ -8829,7 +8819,7 @@ rb_to_symbol(VALUE name) https://github.com/ruby/ruby/blob/trunk/string.c#L8819 return name; } name = string_for_symbol(name); - return rb_str_dynamic_intern(name); + return rb_str_intern(name); } /* @@ -8922,8 +8912,8 @@ Init_String(void) https://github.com/ruby/ruby/blob/trunk/string.c#L8912 rb_define_method(rb_cString, "<<", rb_str_concat, 1); rb_define_method(rb_cString, "prepend", rb_str_prepend, 1); rb_define_method(rb_cString, "crypt", rb_str_crypt, 1); - rb_define_method(rb_cString, "intern", rb_str_dynamic_intern, 0); /* in symbol.c */ - rb_define_method(rb_cString, "to_sym", rb_str_dynamic_intern, 0); /* in symbol.c */ + rb_define_method(rb_cString, "intern", rb_str_intern, 0); /* in symbol.c */ + rb_define_method(rb_cString, "to_sym", rb_str_intern, 0); /* in symbol.c */ rb_define_method(rb_cString, "ord", rb_str_ord, 0); rb_define_method(rb_cString, "include?", rb_str_include, 1); Index: internal.h =================================================================== --- internal.h (revision 47911) +++ internal.h (revision 47912) @@ -822,7 +822,6 @@ int rb_is_method_name(VALUE name); https://github.com/ruby/ruby/blob/trunk/internal.h#L822 int rb_is_junk_name(VALUE name); ID rb_make_internal_id(void); void rb_gc_free_dsymbol(VALUE); -VALUE rb_str_dynamic_intern(VALUE); ID rb_id_attrget(ID id); /* proc.c */ Index: marshal.c =================================================================== --- marshal.c (revision 47911) +++ marshal.c (revision 47912) @@ -452,7 +452,7 @@ static void https://github.com/ruby/ruby/blob/trunk/marshal.c#L452 w_unique(VALUE s, struct dump_arg *arg) { must_not_be_anonymous("class", s); - w_symbol(rb_str_dynamic_intern(s), arg); + w_symbol(rb_str_intern(s), arg); } static void w_object(VALUE,struct dump_arg*,int); @@ -1327,7 +1327,7 @@ r_symreal(struct load_arg *arg, int ivar https://github.com/ruby/ruby/blob/trunk/marshal.c#L1327 } } if (idx > 0) rb_enc_associate_index(s, idx); - sym = rb_str_dynamic_intern(s); + sym = rb_str_intern(s); st_insert(arg->symbols, (st_data_t)n, (st_data_t)sym); return sym; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/