mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
[ruby/json] Directly write to the output buffer when converting UTF32 to UTF8.
https://github.com/ruby/json/commit/a51317c949
This commit is contained in:
parent
d7a6ff8224
commit
b6463d59e7
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user