Commit 92932c66 authored by Walter Dörwald's avatar Walter Dörwald

When creating a unicode object from a char * characters

are always < 256 => remove the test.
parent 6f42e8c0
...@@ -408,9 +408,8 @@ PyObject *PyUnicode_FromString(const char *u) ...@@ -408,9 +408,8 @@ PyObject *PyUnicode_FromString(const char *u)
return (PyObject *)unicode_empty; return (PyObject *)unicode_empty;
} }
/* Single character Unicode objects in the Latin-1 range are /* Single characters are shared when using this constructor */
shared when using this constructor */ if (size == 1) {
if (size == 1 && *u < 256) {
unicode = unicode_latin1[*u]; unicode = unicode_latin1[*u];
if (!unicode) { if (!unicode) {
unicode = _PyUnicode_New(1); unicode = _PyUnicode_New(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment