From: Raymond Hettinger Date: Fri, 27 Feb 2004 10:30:49 +0000 (+0000) Subject: Speed-up the joiner call by avoiding Py_BuildValue(). X-Git-Tag: v2.4a1~765 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bc72c5ae8b5cfa261c6d150386fc56cff3f8955f;p=thirdparty%2FPython%2Fcpython.git Speed-up the joiner call by avoiding Py_BuildValue(). --- diff --git a/Modules/cStringIO.c b/Modules/cStringIO.c index ee11878730c0..4ec5e88c8804 100644 --- a/Modules/cStringIO.c +++ b/Modules/cStringIO.c @@ -436,7 +436,11 @@ O_writelines(Oobject *self, PyObject *args) { if (PyObject_Size(args) < 0) return NULL; - tmp = PyObject_CallFunction(joiner, "O", args); + args = PyTuple_Pack(1, args); + if (args == NULL) + return NULL; + tmp = PyObject_Call(joiner, args, NULL); + Py_DECREF(args); UNLESS (tmp) return NULL; args = PyTuple_Pack(1, tmp);