diff options
author | Fredrik Lundh <fredrik@pythonware.com> | 2006-05-26 09:46:59 (GMT) |
---|---|---|
committer | Fredrik Lundh <fredrik@pythonware.com> | 2006-05-26 09:46:59 (GMT) |
commit | 450277fef50c213b14b88c4fe939bd32eeecee36 (patch) | |
tree | e94a377d67075581188015bc2e4d6a7a736553c5 /Objects/unicodeobject.c | |
parent | 0c93ff67097f3cb524ac6f7247bd29f487352471 (diff) | |
download | cpython-450277fef50c213b14b88c4fe939bd32eeecee36.zip cpython-450277fef50c213b14b88c4fe939bd32eeecee36.tar.gz cpython-450277fef50c213b14b88c4fe939bd32eeecee36.tar.bz2 |
needforspeed: use METH_O for argument handling, which made partition some
~15% faster for the current tests (which is noticable faster than a corre-
sponding find call). thanks to neal-who-never-sleeps for the tip.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 7702248..8291400 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -6357,13 +6357,8 @@ the separator itself, and the part after it. If the separator is not\n\ found, returns S and two empty strings."); static PyObject* -unicode_partition(PyUnicodeObject *self, PyObject *args) +unicode_partition(PyUnicodeObject *self, PyObject *separator) { - PyObject *separator; - - if (!PyArg_ParseTuple(args, "O:partition", &separator)) - return NULL; - return PyUnicode_Partition((PyObject *)self, separator); } @@ -6620,7 +6615,7 @@ static PyMethodDef unicode_methods[] = { {"count", (PyCFunction) unicode_count, METH_VARARGS, count__doc__}, {"expandtabs", (PyCFunction) unicode_expandtabs, METH_VARARGS, expandtabs__doc__}, {"find", (PyCFunction) unicode_find, METH_VARARGS, find__doc__}, - {"partition", (PyCFunction) unicode_partition, METH_VARARGS, partition__doc__}, + {"partition", (PyCFunction) unicode_partition, METH_O, partition__doc__}, {"index", (PyCFunction) unicode_index, METH_VARARGS, index__doc__}, {"ljust", (PyCFunction) unicode_ljust, METH_VARARGS, ljust__doc__}, {"lower", (PyCFunction) unicode_lower, METH_NOARGS, lower__doc__}, |