Mercurial > cpython-lru_cache-weakref
diff Objects/unicodeobject.c @ 73678:754d79aee7ab
UTF-8 decoder: set consumed value in the latin1 fast-path
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Tue, 22 Nov 2011 01:23:02 +0100 |
| parents | 123f2dc08b3e |
| children | 0679344ffff2 |
line wrap: on
line diff
--- a/Objects/unicodeobject.c Tue Nov 22 01:22:34 2011 +0100 +++ b/Objects/unicodeobject.c Tue Nov 22 01:23:02 2011 +0100 @@ -4391,6 +4391,9 @@ 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]);
