cpython: 45d2b5c12b19 (original) (raw)
Mercurial > cpython
changeset 102778:45d2b5c12b19
slot_tp_iter() now uses fast call Issue #27128: slot_tp_iter() now calls _PyObject_FastCall() to avoid a temporary empty tuple. [#27128]
Victor Stinner victor.stinner@gmail.com | |
---|---|
date | Fri, 19 Aug 2016 18:41:02 +0200 |
parents | 6a21b6599692 |
children | 124d5d0ef81f |
files | Objects/typeobject.c |
diffstat | 1 files changed, 3 insertions(+), 6 deletions(-)[+] [-] Objects/typeobject.c 9 |
line wrap: on
line diff
--- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -6264,16 +6264,13 @@ slot_tp_iter(PyObject *self) Py_TYPE(self)->tp_name); return NULL; } + if (func != NULL) {
PyObject *args;[](#l1.9)
args = res = PyTuple_New(0);[](#l1.10)
if (args != NULL) {[](#l1.11)
res = PyObject_Call(func, args, NULL);[](#l1.12)
Py_DECREF(args);[](#l1.13)
}[](#l1.14)