[Python-checkins] cpython: UTF-8 decoder: set consumed value in the latin1 fast-path

victor.stinner python-checkins at python.org
Tue Nov 22 01:20:50 CET 2011


http://hg.python.org/cpython/rev/754d79aee7ab
changeset:   73678:754d79aee7ab
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Tue Nov 22 01:23:02 2011 +0100
summary:
  UTF-8 decoder: set consumed value in the latin1 fast-path

files:
  Objects/unicodeobject.c |  3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)


diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -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]);
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list