Skip to content

Commit

Permalink
Use rb_str_new_frozen
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Nov 3, 2024
1 parent 810c0e7 commit 90c8aaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/json/ext/generator/generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ static VALUE string_config(VALUE config)
if (RTEST(config)) {
Check_Type(config, T_STRING);
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;
Expand Down

0 comments on commit 90c8aaa

Please sign in to comment.