mirror of
https://github.com/python/cpython.git
synced 2026-01-04 14:32:21 +00:00
Make PyDescr_IsData() a macro. It's too simple to be a function.
Should save 4% on slot lookups.
This commit is contained in:
parent
69734a5272
commit
492b46f29e
2 changed files with 1 additions and 7 deletions
|
|
@ -76,7 +76,7 @@ PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *,
|
|||
struct PyGetSetDef *);
|
||||
PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *,
|
||||
struct wrapperbase *, void *);
|
||||
PyAPI_FUNC(int) PyDescr_IsData(PyObject *);
|
||||
#define PyDescr_IsData(d) ((d)->ob_type->tp_descr_set != NULL)
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *);
|
||||
|
|
|
|||
|
|
@ -555,12 +555,6 @@ PyDescr_NewWrapper(PyTypeObject *type, struct wrapperbase *base, void *wrapped)
|
|||
return (PyObject *)descr;
|
||||
}
|
||||
|
||||
int
|
||||
PyDescr_IsData(PyObject *d)
|
||||
{
|
||||
return d->ob_type->tp_descr_set != NULL;
|
||||
}
|
||||
|
||||
|
||||
/* --- Readonly proxy for dictionaries (actually any mapping) --- */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue