diff Modules/cStringIO.c @ 31593:706d6d11ee36 legacy-trunk

Speed-up the joiner call by avoiding Py_BuildValue().
author Raymond Hettinger <python@rcn.com>
date Fri, 27 Feb 2004 10:30:49 +0000
parents 3b59fa5d25b1
children 1543afab1b67
line wrap: on
line diff
--- a/Modules/cStringIO.c	Thu Feb 26 16:21:45 2004 +0000
+++ b/Modules/cStringIO.c	Fri Feb 27 10:30:49 2004 +0000
@@ -436,7 +436,11 @@
 
         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);