From 5617e317713b55d544fb493d9346d2330c60c727 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 14 Oct 2014 07:23:01 +0000 Subject: 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ internal.h | 1 - iseq.c | 2 +- marshal.c | 4 ++-- string.c | 26 ++++++++------------------ symbol.c | 4 ++-- 6 files changed, 20 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index c9f9ec5588..7565f6833f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Oct 14 16:22:59 2014 Nobuyoshi Nakada + + * 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 * test/ruby/test_optimization.rb (test_string_freeze): new test diff --git a/internal.h b/internal.h index a9fd533cd2..a076abf4e7 100644 --- a/internal.h +++ b/internal.h @@ -822,7 +822,6 @@ int rb_is_method_name(VALUE name); 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 */ diff --git a/iseq.c b/iseq.c index 2872d4f131..2bfdf7c9ed 100644 --- a/iseq.c +++ b/iseq.c @@ -1617,7 +1617,7 @@ ruby_node_name(int node) 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; } diff --git a/marshal.c b/marshal.c index acd962ea11..14069fb76d 100644 --- a/marshal.c +++ b/marshal.c @@ -452,7 +452,7 @@ static void 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) } } 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; diff --git a/string.c b/string.c index 6e50b8ef2e..c2501f99b1 100644 --- a/string.c +++ b/string.c @@ -7548,16 +7548,6 @@ rb_str_crypt(VALUE str, VALUE salt) } -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) 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) 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) 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) 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) 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) 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) 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); diff --git a/symbol.c b/symbol.c index cc7da77ead..b2c9f4538e 100644 --- a/symbol.c +++ b/symbol.c @@ -155,7 +155,7 @@ rb_id_attrset(ID id) /* 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) */ VALUE -rb_str_dynamic_intern(VALUE str) +rb_str_intern(VALUE str) { #if USE_SYMBOL_GC rb_encoding *enc, *ascii; -- cgit v1.2.3