]> granicus.if.org Git - python/commitdiff
When creating a unicode object from a char * characters
authorWalter Dörwald <walter@livinglogic.de>
Sat, 5 May 2007 14:21:20 +0000 (14:21 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Sat, 5 May 2007 14:21:20 +0000 (14:21 +0000)
are always < 256 => remove the test.

Objects/unicodeobject.c

index c9a922dd80c82663fb956ef3e69b35c89178484e..4599414984d678a739e8c7af5f2e849b4ba93708 100644 (file)
@@ -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);