mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 12:14:51 +00:00
[ruby/erb] html_escape: refactor redundant if
(https://github.com/ruby/erb/pull/88) https://github.com/ruby/erb/commit/c231ced3f4
This commit is contained in:
parent
f0a76f6295
commit
d11df4172e
@ -63,16 +63,13 @@ optimized_escape_html(VALUE str)
|
||||
dest += len;
|
||||
}
|
||||
}
|
||||
VALUE escaped = str;
|
||||
if (buf) {
|
||||
size_t segment_len = cstr - segment_start;
|
||||
if (segment_len) {
|
||||
memcpy(dest, segment_start, segment_len);
|
||||
dest += segment_len;
|
||||
}
|
||||
}
|
||||
|
||||
VALUE escaped = str;
|
||||
if (buf) {
|
||||
escaped = rb_str_new(buf, dest - buf);
|
||||
preserve_original_state(str, escaped);
|
||||
ALLOCV_END(vbuf);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user