From 983b1434bda1819864fb5d82248f249358a4c22d Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 12 Oct 2011 00:54:35 +0200 Subject: [PATCH] Backed out changeset 952d91a7d376 If maxchar == PyUnicode_MAX_CHAR_VALUE(unicode), we do an useless copy. --- Objects/unicodeobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 6740a75babb..10422544359 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -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);