]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
don't ready in case_operation, since most callers do it themselves
authorBenjamin Peterson <benjamin@python.org>
Mon, 16 Jan 2012 19:28:50 +0000 (14:28 -0500)
committerBenjamin Peterson <benjamin@python.org>
Mon, 16 Jan 2012 19:28:50 +0000 (14:28 -0500)
Objects/unicodeobject.c

index 59fc123790666144ae82683a74fa20a7c566a0c6..648d9a066130e7a5bca776b5e5e5ab3b597e5a3f 100644 (file)
@@ -9644,8 +9644,7 @@ case_operation(PyObject *self,
     void *data, *outdata;
     Py_UCS4 maxchar = 0, *tmp, *tmpend;
 
-    if (PyUnicode_READY(self) == -1)
-        return NULL;
+    assert(PyUnicode_IS_READY(self));
 
     kind = PyUnicode_KIND(self);
     data = PyUnicode_DATA(self);
@@ -10512,6 +10511,8 @@ characters, all remaining cased characters have lower case.");
 static PyObject*
 unicode_title(PyObject *self)
 {
+    if (PyUnicode_READY(self) == -1)
+        return NULL;
     return case_operation(self, do_title);
 }
 
@@ -12657,6 +12658,8 @@ and vice versa.");
 static PyObject*
 unicode_swapcase(PyObject *self)
 {
+    if (PyUnicode_READY(self) == -1)
+        return NULL;
     return case_operation(self, do_swapcase);
 }