[Python-checkins] python/dist/src/Include abstract.h,2.49,2.50
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Fri Mar 12 03:04:30 EST 2004
Update of /cvsroot/python/python/dist/src/Include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18208/Include
Modified Files:
abstract.h
Log Message:
Use a new macro, PySequence_Fast_ITEMS to factor out code common to
three recent optimizations. Aside from reducing code volume, it
increases readability.
Index: abstract.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/abstract.h,v
retrieving revision 2.49
retrieving revision 2.50
diff -C2 -d -r2.49 -r2.50
*** abstract.h 20 Oct 2003 14:01:48 -0000 2.49
--- abstract.h 12 Mar 2004 08:03:40 -0000 2.50
***************
*** 1017,1020 ****
--- 1017,1026 ----
*/
+ #define _PySequence_Fast_ITEMS(sf) \
+ (PyList_Check(sf) ? ((PyListObject *)(sf))->ob_item \
+ : ((PyTupleObject *)(sf))->ob_item)
+ /* Return a pointer to the underlying item array for
+ an object retured by PySequence_Fast */
+
PyAPI_FUNC(int) PySequence_Count(PyObject *o, PyObject *value);
More information about the Python-checkins
mailing list