summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2021-02-01 17:58:06 +0100
committerAaron Patterson <[email protected]>2021-03-10 13:44:07 -0800
commitef88225886dd4ceecae07ddd22108ef4da542396 (patch)
tree7fe08b14046ce2551355b24acb96004a964384bf /compile.c
parent1041bff3b226fc0ea5235c1f3c71d7dcedbf1acc (diff)
Simplify ibf_dump_object_symbol by delegating to ibf_dump_object_string
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4119
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/compile.c b/compile.c
index 7c0ecec7a6..3193be8e5e 100644
--- a/compile.c
+++ b/compile.c
@@ -11634,21 +11634,7 @@ ibf_load_object_complex_rational(const struct ibf_load *load, const struct ibf_o
static void
ibf_dump_object_symbol(struct ibf_dump *dump, VALUE obj)
{
- VALUE str = rb_sym2str(obj);
-
- long encindex = (long)rb_enc_get_index(str);
- long len = RSTRING_LEN(str);
- const char *ptr = RSTRING_PTR(str);
-
- if (encindex > RUBY_ENCINDEX_BUILTIN_MAX) {
- rb_encoding *enc = rb_enc_from_index((int)encindex);
- const char *enc_name = rb_enc_name(enc);
- encindex = RUBY_ENCINDEX_BUILTIN_MAX + ibf_dump_object(dump, rb_str_new2(enc_name));
- }
-
- ibf_dump_write_small_value(dump, encindex);
- ibf_dump_write_small_value(dump, len);
- IBF_WP(ptr, char, len);
+ ibf_dump_object_string(dump, rb_sym2str(obj));
}
static VALUE