mirror of
https://github.com/python/cpython.git
synced 2024-11-24 18:34:43 +08:00
UTF-8 decoder: set consumed value in the latin1 fast-path
This commit is contained in:
parent
d3df8ab377
commit
42885206ec
@ -4391,6 +4391,9 @@ PyUnicode_DecodeUTF8Stateful(const char *s,
|
||||
unicode_size may be != size if there is an incomplete UTF-8
|
||||
sequence at the end of the ASCII block. */
|
||||
if (maxchar < 128 && size == unicode_size) {
|
||||
if (consumed)
|
||||
*consumed = size;
|
||||
|
||||
if (size == 1)
|
||||
return get_latin1_char((unsigned char)s[0]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user