From 09b2d50c0d8d51d884e87076f54671845be322d5 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 9 Dec 2016 15:39:28 +0100 Subject: Use _PyObject_CallMethodIdObjArgs() in _io Issue #28915: Replace _PyObject_CallMethodId() with _PyObject_CallMethodIdObjArgs() when the format string was only made of "O" formats, PyObject* arguments. _PyObject_CallMethodIdObjArgs() avoids the creation of a temporary tuple and doesn't have to parse a format string. --- Modules/_io/iobase.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Modules/_io/iobase.c') diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c index 472ef3b97c..ee6ad474b5 100644 --- a/Modules/_io/iobase.c +++ b/Modules/_io/iobase.c @@ -661,7 +661,8 @@ _io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint) to remove the bytecode interpretation overhead, but it could probably be removed here. */ _Py_IDENTIFIER(extend); - PyObject *ret = _PyObject_CallMethodId(result, &PyId_extend, "O", self); + PyObject *ret = _PyObject_CallMethodIdObjArgs(result, &PyId_extend, + self, NULL); if (ret == NULL) { Py_DECREF(result); -- cgit v1.2.1