]> granicus.if.org Git - python/commitdiff
Speed-up the joiner call by avoiding Py_BuildValue().
authorRaymond Hettinger <python@rcn.com>
Fri, 27 Feb 2004 10:30:49 +0000 (10:30 +0000)
committerRaymond Hettinger <python@rcn.com>
Fri, 27 Feb 2004 10:30:49 +0000 (10:30 +0000)
Modules/cStringIO.c

index ee11878730c0357965053f3584b7a24b369f1069..4ec5e88c88046031da4f435389b358944780dcd8 100644 (file)
@@ -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);