mirror of
https://github.com/python/cpython.git
synced 2025-11-29 14:31:30 +00:00
Issue #26822: Decreased an overhead of using _PyArg_NoKeywords() in calls of
itemgetter, attrgetter and methodcaller objects.
This commit is contained in:
parent
42f740d854
commit
6dfcde5e29
1 changed files with 3 additions and 3 deletions
|
|
@ -460,7 +460,7 @@ itemgetter_call(itemgetterobject *ig, PyObject *args, PyObject *kw)
|
||||||
PyObject *obj, *result;
|
PyObject *obj, *result;
|
||||||
Py_ssize_t i, nitems=ig->nitems;
|
Py_ssize_t i, nitems=ig->nitems;
|
||||||
|
|
||||||
if (!_PyArg_NoKeywords("itemgetter", kw))
|
if (kw != NULL && !_PyArg_NoKeywords("itemgetter", kw))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (!PyArg_UnpackTuple(args, "itemgetter", 1, 1, &obj))
|
if (!PyArg_UnpackTuple(args, "itemgetter", 1, 1, &obj))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -749,7 +749,7 @@ attrgetter_call(attrgetterobject *ag, PyObject *args, PyObject *kw)
|
||||||
PyObject *obj, *result;
|
PyObject *obj, *result;
|
||||||
Py_ssize_t i, nattrs=ag->nattrs;
|
Py_ssize_t i, nattrs=ag->nattrs;
|
||||||
|
|
||||||
if (!_PyArg_NoKeywords("attrgetter", kw))
|
if (kw != NULL && !_PyArg_NoKeywords("attrgetter", kw))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (!PyArg_UnpackTuple(args, "attrgetter", 1, 1, &obj))
|
if (!PyArg_UnpackTuple(args, "attrgetter", 1, 1, &obj))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -992,7 +992,7 @@ methodcaller_call(methodcallerobject *mc, PyObject *args, PyObject *kw)
|
||||||
{
|
{
|
||||||
PyObject *method, *obj, *result;
|
PyObject *method, *obj, *result;
|
||||||
|
|
||||||
if (!_PyArg_NoKeywords("methodcaller", kw))
|
if (kw != NULL && !_PyArg_NoKeywords("methodcaller", kw))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (!PyArg_UnpackTuple(args, "methodcaller", 1, 1, &obj))
|
if (!PyArg_UnpackTuple(args, "methodcaller", 1, 1, &obj))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue