mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[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
1 changed files with 3 additions and 1 deletions
|
@ -76,7 +76,9 @@ optimized_escape_html(VALUE str)
|
|||
static VALUE
|
||||
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)) {
|
||||
return optimized_escape_html(str);
|
||||
|
|
Loading…
Reference in a new issue