]> granicus.if.org Git - python/commitdiff
Make PyDescr_IsData() a macro. It's too simple to be a function.
authorGuido van Rossum <guido@python.org>
Mon, 19 Aug 2002 18:45:37 +0000 (18:45 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 19 Aug 2002 18:45:37 +0000 (18:45 +0000)
Should save 4% on slot lookups.

Include/descrobject.h
Objects/descrobject.c

index 13190365b5553c644809813ce8c05131b13da78d..6fb6a95cc4e83ea2ff80977ebae637563b28434f 100644 (file)
@@ -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 *);
index 6daffc617547cdcd02280c6c8fc492d3e849295e..fc9d9a1eaa35725cacc4d24aef35b0ecfe81daa7 100644 (file)
@@ -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) --- */