Move encoding object conversion outside of parser

Reduce the parser's dependence on `VALUE` and `rb_enc_from_encoding`.
This commit is contained in:
yui-knk 2024-04-23 11:27:42 +09:00 committed by Yuichiro Kaneko
parent e15a1920ca
commit 33929ef995
4 changed files with 5 additions and 5 deletions

View file

@ -827,7 +827,7 @@ rb_parser_encoding(VALUE vparser)
struct ruby_parser *parser;
TypedData_Get_Struct(vparser, struct ruby_parser, &ruby_parser_data_type, parser);
return rb_ruby_parser_encoding(parser->parser_params);
return rb_enc_from_encoding(rb_ruby_parser_encoding(parser->parser_params));
}
VALUE