[ruby/json] Use rb_str_new_frozen

https://github.com/ruby/json/commit/90c8aaaa6a
This commit is contained in:
Jean Boussier 2024-11-03 10:22:20 +01:00
parent ed22e68379
commit 2f84a02ad5
Notes: git 2024-11-05 17:00:59 +00:00

View File

@ -1113,7 +1113,7 @@ static VALUE string_config(VALUE config)
if (RTEST(config)) { if (RTEST(config)) {
Check_Type(config, T_STRING); Check_Type(config, T_STRING);
if (RSTRING_LEN(config)) { if (RSTRING_LEN(config)) {
return RB_OBJ_FROZEN(config) ? config : rb_str_freeze(rb_str_dup(config)); return rb_str_new_frozen(config);
} }
} }
return Qfalse; return Qfalse;