[Python-checkins] r46366 - python/trunk/Objects/stringobject.c

fredrik.lundh python-checkins at python.org
Fri May 26 19:26:40 CEST 2006


Author: fredrik.lundh
Date: Fri May 26 19:26:39 2006
New Revision: 46366

Modified:
   python/trunk/Objects/stringobject.c
Log:
needforspeed: cleanup



Modified: python/trunk/Objects/stringobject.c
==============================================================================
--- python/trunk/Objects/stringobject.c	(original)
+++ python/trunk/Objects/stringobject.c	Fri May 26 19:26:39 2006
@@ -1544,8 +1544,8 @@
 static PyObject *
 string_partition(PyStringObject *self, PyObject *sep_obj)
 {
-	Py_ssize_t str_len = PyString_GET_SIZE(self), sep_len;
-	const char *str = PyString_AS_STRING(self), *sep;
+	const char *sep;
+	Py_ssize_t sep_len;
 
 	if (PyString_Check(sep_obj)) {
 		sep = PyString_AS_STRING(sep_obj);
@@ -1553,12 +1553,16 @@
 	}
 #ifdef Py_USING_UNICODE
 	else if (PyUnicode_Check(sep_obj))
-		return PyUnicode_Partition((PyObject *)self, sep_obj);
+		return PyUnicode_Partition((PyObject *) self, sep_obj);
 #endif
 	else if (PyObject_AsCharBuffer(sep_obj, &sep, &sep_len))
 		return NULL;
 
-	return partition((PyObject*)self, str, str_len, sep_obj, sep, sep_len);
+	return partition(
+		(PyObject*) self,
+		PyString_AS_STRING(self), PyString_GET_SIZE(self),
+		sep_obj, sep, sep_len
+		);
 }
 
 Py_LOCAL(PyObject *)


More information about the Python-checkins mailing list