[ruby/erb] Optimize away the rb_convert_type call using RB_TYPE_P
https://github.com/ruby/erb/commit/12058c3784
This commit is contained in:
parent
e8873e01b6
commit
458d6fb15e
@ -76,7 +76,9 @@ optimized_escape_html(VALUE str)
|
|||||||
static VALUE
|
static VALUE
|
||||||
erb_escape_html(VALUE self, VALUE str)
|
erb_escape_html(VALUE self, VALUE str)
|
||||||
{
|
{
|
||||||
str = rb_convert_type(str, T_STRING, "String", "to_s");
|
if (!RB_TYPE_P(str, T_STRING)) {
|
||||||
|
str = rb_convert_type(str, T_STRING, "String", "to_s");
|
||||||
|
}
|
||||||
|
|
||||||
if (rb_enc_str_asciicompat_p(str)) {
|
if (rb_enc_str_asciicompat_p(str)) {
|
||||||
return optimized_escape_html(str);
|
return optimized_escape_html(str);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user