diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-09-06 00:53:15 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-09-06 00:53:15 (GMT) |
commit | ad8c83ad6b91bebbc124c0c36e67b9836ca3d90f (patch) | |
tree | 18c2f0bdd40db2aa568b9e4a5f87d2f88ff70059 /Modules/_pickle.c | |
parent | ca08301ae0cc5e4e7b57e2283542815efbff86bb (diff) | |
download | cpython-ad8c83ad6b91bebbc124c0c36e67b9836ca3d90f.zip cpython-ad8c83ad6b91bebbc124c0c36e67b9836ca3d90f.tar.gz cpython-ad8c83ad6b91bebbc124c0c36e67b9836ca3d90f.tar.bz2 |
Avoid inefficient way to call functions without argument
Don't pass "()" format to PyObject_CallXXX() to call a function without
argument: pass NULL as the format string instead. It avoids to have to parse a
string to produce 0 argument.
Diffstat (limited to 'Modules/_pickle.c')
-rw-r--r-- | Modules/_pickle.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c index a8d414e..eae3394 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -2873,7 +2873,7 @@ save_dict(PicklerObject *self, PyObject *obj) } else { _Py_IDENTIFIER(items); - items = _PyObject_CallMethodId(obj, &PyId_items, "()"); + items = _PyObject_CallMethodId(obj, &PyId_items, NULL); if (items == NULL) goto error; iter = PyObject_GetIter(items); |