]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backed out changeset 952d91a7d376
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 11 Oct 2011 22:54:35 +0000 (00:54 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 11 Oct 2011 22:54:35 +0000 (00:54 +0200)
If maxchar == PyUnicode_MAX_CHAR_VALUE(unicode), we do an useless copy.

Objects/unicodeobject.c

index 6740a75babb29ef308e8f5d0e511898b875f4355..10422544359478a72726a12bf3435009f07c4efe 100644 (file)
@@ -1837,7 +1837,7 @@ unicode_adjust_maxchar(PyObject **p_unicode)
             }
         }
     }
-    assert(max_char <= PyUnicode_MAX_CHAR_VALUE(unicode));
+    assert(max_char < PyUnicode_MAX_CHAR_VALUE(unicode));
     copy = PyUnicode_New(len, max_char);
     copy_characters(copy, 0, unicode, 0, len);
     Py_DECREF(unicode);