Cc: p.stephani2@gmail.com, sebastien@chapu.is, yyoncho@gmail.com,
31138@debbugs.gnu.org
From: Dmitry Gutov <dgutov@yandex.ru>
Date: Mon, 22 Apr 2019 19:16:15 +0300
All right. Does the attached json_encode_string_ascii_test.diff look
good to you?
The size == nchars case not necessarily true just for ASCII, I think,
and the code in parse_str_as_multibyte is more complex than needed
just for ASCII. I meant make a loop that literally checks only for
ASCII_CHAR_P, and nothing more. I think it makes sense to see first
how much can we speed up things for pure ASCII JSONs.
+ if (size == nchars)
+ /* Wasn't sure if the last arg should better be true here, but
+ it doesn't seem to affect the behavior or correctness, so far. */
+ return make_specified_string (data, -1, size, false);
It should make no difference for ASCII, but I think I prefer to use
'true' there, for consistency with the other cases.