From: Walter Dörwald Date: Sat, 5 May 2007 14:21:20 +0000 (+0000) Subject: When creating a unicode object from a char * characters X-Git-Tag: v3.0a1~1009 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=071b9da1469e30306fc91d6e26d12c4a8b1f10f8;p=thirdparty%2FPython%2Fcpython.git When creating a unicode object from a char * characters are always < 256 => remove the test. --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index c9a922dd80c8..4599414984d6 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -408,9 +408,8 @@ PyObject *PyUnicode_FromString(const char *u) return (PyObject *)unicode_empty; } - /* Single character Unicode objects in the Latin-1 range are - shared when using this constructor */ - if (size == 1 && *u < 256) { + /* Single characters are shared when using this constructor */ + if (size == 1) { unicode = unicode_latin1[*u]; if (!unicode) { unicode = _PyUnicode_New(1);