diff options
author | Raymond Hettinger <python@rcn.com> | 2004-02-27 10:30:49 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-02-27 10:30:49 (GMT) |
commit | bc72c5ae8b5cfa261c6d150386fc56cff3f8955f (patch) | |
tree | c70ff25927db32c81497b9206b6f85d4d6dc770a /Modules | |
parent | 2460c62152fe43f9da9381d09fd294f21e3640d7 (diff) | |
download | cpython-bc72c5ae8b5cfa261c6d150386fc56cff3f8955f.zip cpython-bc72c5ae8b5cfa261c6d150386fc56cff3f8955f.tar.gz cpython-bc72c5ae8b5cfa261c6d150386fc56cff3f8955f.tar.bz2 |
Speed-up the joiner call by avoiding Py_BuildValue().
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/cStringIO.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/cStringIO.c b/Modules/cStringIO.c index ee11878..4ec5e88 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); |