diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-12-08 23:36:19 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-12-08 23:36:19 (GMT) |
commit | 7e42541d08b6cc103b892c1cb70ea68c66751078 (patch) | |
tree | 082013fb3c953cb156f6591cbc3bcca6db787ca8 /Objects | |
parent | 4c38154a432885a933b539c2682e66caaf440117 (diff) | |
download | cpython-7e42541d08b6cc103b892c1cb70ea68c66751078.zip cpython-7e42541d08b6cc103b892c1cb70ea68c66751078.tar.gz cpython-7e42541d08b6cc103b892c1cb70ea68c66751078.tar.bz2 |
Use _PyObject_CallMethodIdObjArgs()
Issue #28915: Replace _PyObject_CallMethodId() with
_PyObject_CallMethodIdObjArgs() when the format string only use the format 'O'
for objects, like "(O)".
_PyObject_CallMethodIdObjArgs() avoids the code to parse a format string and
avoids the creation of a temporary tuple.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/descrobject.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 076e741..ee356b1 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -804,7 +804,8 @@ mappingproxy_get(mappingproxyobject *pp, PyObject *args) if (!PyArg_UnpackTuple(args, "get", 1, 2, &key, &def)) return NULL; - return _PyObject_CallMethodId(pp->mapping, &PyId_get, "(OO)", key, def); + return _PyObject_CallMethodIdObjArgs(pp->mapping, &PyId_get, + key, def, NULL); } static PyObject * |