diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2019-06-04 19:58:39 +0900 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2019-06-05 10:08:55 +0900 |
commit | 8d81e59aa7a62652caf85f9c8db371703668c149 (patch) | |
tree | c30a047f31e5a7d2fb02158831c61cd191b566b2 /regexec.c | |
parent | b31e1b4a7c5b97d861c2b34ed4ccd982d5c6cb82 (diff) | |
download | ruby-8d81e59aa7a62652caf85f9c8db371703668c149.tar.gz |
Optimize CGI.escapeHTML by reducing buffer extension
and switch-case branches.
Buffer allocation optimization using `ALLOCA_N` would be the main
benefit of patch. It eliminates the O(N) buffer extensions.
It also reduces the number of branches using escape table like
https://mattn.kaoriya.net/software/lang/c/20160817011915.htm.
Closes: https://github.com/ruby/ruby/pull/2226
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Co-authored-by: Yasuhiro MATSUMOTO <mattn.jp@gmail.com>
Diffstat (limited to 'regexec.c')
0 files changed, 0 insertions, 0 deletions