mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
20401deae2
commit
61bdb0d319
5 changed files with 14 additions and 10 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue