summaryrefslogtreecommitdiff
path: root/variable.h
diff options
context:
space:
mode:
authorSharon Rosner <sharon@noteflakes.com>2025-10-12 00:35:54 +0200
committergit <svn-admin@ruby-lang.org>2025-10-11 22:36:21 +0000
commitfa54a9c9e58fa810ccef9eef86dd7ba8f1763f2d (patch)
tree711d51a34dc5552ced8fd811096b9e325f441393 /variable.h
parent89dc79eeba9b450d2cc921b428fd4519f5e04690 (diff)
[ruby/erb] html_escape: Avoid buffer allocation for strings with no
escapable character (https://github.com/ruby/erb/pull/87) This change improves reduces allocations and makes `html_escape` ~35% faster in a benchmark with escaped strings taken from the `test_html_escape` test in `test/test_erb.rb`. - Perform buffer allocation on first instance of escapable character. - Instead of copying characters one at a time, copy unescaped segments using `memcpy`. https://github.com/ruby/erb/commit/aa482890fe
Diffstat (limited to 'variable.h')
0 files changed, 0 insertions, 0 deletions