diff options
| author | Scott Myron <samyron@gmail.com> | 2026-01-02 20:47:59 -0600 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2026-01-03 08:30:20 +0000 |
| commit | b6463d59e7c52dd4493796ff1cbd10b5e25caaca (patch) | |
| tree | 3e8a289981dbac4424ed3c543b5df24ea982ee74 /ext | |
| parent | d7a6ff8224519005d2deeb3f4e98689a8a0835ad (diff) | |
[ruby/json] Directly write to the output buffer when converting UTF32 to UTF8.
https://github.com/ruby/json/commit/a51317c949
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/json/parser/parser.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c index 0ac16918f8..f1ea1b6abb 100644 --- a/ext/json/parser/parser.c +++ b/ext/json/parser/parser.c @@ -739,9 +739,7 @@ NOINLINE(static) VALUE json_string_unescape(JSON_ParserState *state, JSON_Parser } } - char buf[4]; - int unescape_len = convert_UTF32_to_UTF8(buf, ch); - MEMCPY(buffer, buf, char, unescape_len); + int unescape_len = convert_UTF32_to_UTF8(buffer, ch); buffer += unescape_len; p = ++pe; break; |
