diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2019-06-05 19:28:51 +0900 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2019-06-05 21:07:04 +0900 |
commit | 0a29dc87e62c701db56816cb430daf07a4f02bea (patch) | |
tree | 8c4afbace1e6a42d36e0401d2f8b1ddc7bdea373 /regexec.c | |
parent | f3c877e8deaea91ff27c0fca837c9388d030a896 (diff) |
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