summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--string.c5
-rw-r--r--symbol.c10
2 files changed, 3 insertions, 12 deletions
diff --git a/string.c b/string.c
index 3a7113d..394fa8d 100644
--- a/string.c
+++ b/string.c
@@ -10036,6 +10036,8 @@ Init_String(void)
#define rb_intern(str) rb_intern_const(str)
rb_cString = rb_define_class("String", rb_cObject);
+ assert(rb_vm_fstring_table());
+ st_foreach(rb_vm_fstring_table(), fstring_set_class_i, rb_cString);
rb_include_module(rb_cString, rb_mComparable);
rb_define_alloc_func(rb_cString, empty_str_alloc);
rb_define_singleton_method(rb_cString, "try_convert", rb_str_s_try_convert, 1);
@@ -10215,7 +10217,4 @@ Init_String(void)
rb_define_method(rb_cSymbol, "swapcase", sym_swapcase, -1);
rb_define_method(rb_cSymbol, "encoding", sym_encoding, 0);
-
- assert(rb_vm_fstring_table());
- st_foreach(rb_vm_fstring_table(), fstring_set_class_i, rb_cString);
}
diff --git a/symbol.c b/symbol.c
index facdb3c..f4516eb 100644
--- a/symbol.c
+++ b/symbol.c
@@ -744,15 +744,7 @@ rb_sym2str(VALUE sym)
VALUE
rb_id2str(ID id)
{
- VALUE str;
-
- if ((str = lookup_id_str(id)) != 0) {
- if (RBASIC(str)->klass == 0)
- RBASIC_SET_CLASS_RAW(str, rb_cString);
- return str;
- }
-
- return 0;
+ return lookup_id_str(id);
}
const char *