diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-12-09 14:39:28 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-12-09 14:39:28 (GMT) |
commit | 61bdb0d31924ec5fd12aa8dbe197002c57dfbf82 (patch) | |
tree | 8b2b7b6564c1997cea13060a769ddc56240f45c0 /Modules/_io/iobase.c | |
parent | 20401deae219ed38e8a7e9f960ef3b0dc3850dce (diff) | |
download | cpython-61bdb0d31924ec5fd12aa8dbe197002c57dfbf82.zip cpython-61bdb0d31924ec5fd12aa8dbe197002c57dfbf82.tar.gz cpython-61bdb0d31924ec5fd12aa8dbe197002c57dfbf82.tar.bz2 |
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.
Diffstat (limited to 'Modules/_io/iobase.c')
-rw-r--r-- | Modules/_io/iobase.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c index 472ef3b..ee6ad47 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); |