From: Guido van Rossum Date: Mon, 19 Aug 2002 18:45:37 +0000 (+0000) Subject: Make PyDescr_IsData() a macro. It's too simple to be a function. X-Git-Tag: v2.3c1~4403 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=492b46f29e8a706d5f27040d58ba6727d962a548;p=python Make PyDescr_IsData() a macro. It's too simple to be a function. Should save 4% on slot lookups. --- diff --git a/Include/descrobject.h b/Include/descrobject.h index 13190365b5..6fb6a95cc4 100644 --- a/Include/descrobject.h +++ b/Include/descrobject.h @@ -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 *); diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 6daffc6175..fc9d9a1eaa 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -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) --- */