cpython: f9dd607dc04c (original) (raw)

Mercurial > cpython

changeset 105973:f9dd607dc04c

Optimize _PyFunction_FastCallDict() when kwargs is {} Issue #28839: Optimize _PyFunction_FastCallDict() when kwargs is an empty dictionary, avoid the creation of an useless empty tuple. [#28839]

Victor Stinner victor.stinner@gmail.com
date Tue, 03 Jan 2017 02:01:42 +0100
parents 5f7cd3b6c9b1
children e651f8292011
files Python/ceval.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-)[+] [-] Python/ceval.c 8

line wrap: on

line diff

--- a/Python/ceval.c +++ b/Python/ceval.c @@ -5040,9 +5040,9 @@ PyObject * } }

kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { @@ -5052,6 +5052,9 @@ PyObject * k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {

@@ -5061,7 +5064,6 @@ PyObject * else { kwtuple = NULL; k = NULL;